Fork me on GitHub
#announcements
<
2019-11-19
>
yogthos15:11:45

new Domino is out with async events and triggers for generating inputs via effects https://github.com/domino-clj/domino/blob/master/CHANGES.md

partywombat 20
aw_yeah 16
parrot 8
bananadance 8
alexmiller16:11:29

ClojureScript 1.10.597 is now available! https://clojurescript.org/news/2019-11-18-release - Node REPL improvements, Google Closure JS analysis, enhanced type

👍 112
cljs 80
👏 40
hammock 28
🎉 32
aw_yeah 28
sheepy 52
pez17:11:01

> Google Closure JS analysis I saw that demoed on Apropos yesterday. Super mega awesome!

parrot 4
plexus00:11:55

I can't find anything in the changelog about Node REPL improvements. Am I missing something?

carocad22:11:01

Parcera v0.4.0 is out now using Antlr4 instead of Instaparse for upmost performance. Please check the release notes for specifics: https://github.com/carocad/parcera/releases/tag/v0.4.0

aw_yeah 20
👏 4
dominicm01:11:30

@U04V15CAJ release notes contain benchmarks 🙂

borkdude07:11:02

That’s more in the balllpark of tools.reader based solutions

borkdude08:11:30

Nice work @U0LJU20SJ !

🙂 4
carocad08:11:25

@U04V15CAJ @U09LZR36F it would be interesting for me to know how you guys are using such parsers. I think that parcera can be even faster by avoiding the conversion to clojure lazy seqs. Any hints on your use cases 🙂 ?

borkdude08:11:49

@U0LJU20SJ I'm using rewrite-clj for parsing in clj-kondo

borkdude08:11:23

And edamame in https://github.com/borkdude/sci and https://github.com/borkdude/babashka/ So two use cases for me: analysis and execution (which also involves analysis)

carocad09:11:43

I meant it a bit more specific 😅 . so rewrite-clj uses a zipper right ? do you modify the structure inline pass it forward or do you perform some side effects while traversing it ?

borkdude09:11:41

I don't use the zipper part from rewrite-clj for processing

borkdude09:11:52

I do use side effects while processing

carocad10:11:12

> I do use side effects while processing interesting. I am thinking of making an api for looping through the ast without building a collection which should make parcera even faster. If you could help me sketch it out (github issue) it would be an awesome help 🙂

borkdude10:11:01

btw, does parcera also attach location metadata?

borkdude10:11:50

btw, I see antlr4 also supports generating a JS target: https://github.com/antlr/antlr4/blob/master/doc/javascript-target.md

borkdude11:11:20

as for the API, you could support a visitor function, that gets to see every parsed node in the tree? I don't know exactly what it would look like. just try to build an app like a linter or evaluator and you will quickly discover what is needed probably

borkdude11:11:21

maybe the visitor function would also need to see the parent or children in some cases, so I don't know if side-effect only without the tree works for all cases

borkdude12:11:01

@U0LJU20SJ The best way to discover what works is building actual tools with it.

borkdude12:11:42

btw, when trying out parcera 0.4.0 I get:

$ clj -Sdeps '{:deps {carocad/parcera {:mvn/version "RELEASE"} org.antlr/antlr4-runtime {:mvn/version "4.7.1"}}}'
Clojure 1.10.1
user=> (require '[parcera.core])
Syntax error (ClassNotFoundException) compiling at (parcera/antlr/java.clj:1:1).
parcera.antlr.ClojureParser
user=>

carocad13:11:30

@U04V15CAJ you need to add antlr-runtime to your deps. See usage: https://github.com/carocad/parcera#usage

borkdude13:11:49

I did, see my :deps

borkdude13:11:21

maybe your dependency has to package compiled classes?

borkdude13:11:52

it expects the class parcera.antlr.ClojureParser to be around, which doesn't seem to be in your dep

carocad13:11:54

oh sorry my mistake. It seems that the generated ClojureParser from antlr was not packed :thinking_face: ? I thought that leiningen takes care of that by using the java-sources

borkdude13:11:16

only if you call the javac task

borkdude13:11:37

minor issue: the README still refers to instaparse

👀 4
carocad13:11:05

> btw, does parcera also attach location metadata? yes > btw, I see antlr4 also supports generating a JS target: yeah, I havent been able to get it working, see https://github.com/carocad/parcera/issues/25

borkdude13:11:56

major issue:

:java-source-paths ["src/java"]
this path doesn't seem to be present in your git repo

carocad13:11:29

those are automatically generated files, therefore I dont include them in the git history. However it is present when building https://github.com/carocad/parcera/blob/master/.travis.yml#L19

borkdude13:11:17

ok well, maybe it's good to add that to the README then, how to build this stuff

4
borkdude13:11:12

is the problem with JS that you do manage to build the JS file, but you don't get it to work with CLJS?

carocad13:11:15

I will take a look at the missing java class. I suspect that publishing is missing the java files … even though I would expect an error if that was the case :thinking_face:

borkdude13:11:04

like I said, you need the javac task: javac Compile Java source files.

👀 4
carocad13:11:06

> is the problem with JS that you do manage to build the JS file, but you don’t get it to work with CLJS? yes, when passing the generated js files through closure compiler they “get damaged” and importing doesnt work anymore. Might be my lack of knowledge though

borkdude13:11:41

ok, don't know about :module-type :es6, have you tried without that setting?

borkdude13:11:21

compile probably doesn't do what you think it does, it AOTs Clojure code, it's not related to Java sources

carocad13:11:58

> ok, don’t know about :module-type :es6, have you tried without that setting? yeah, I tried the other module types and it also didnt work

borkdude13:11:17

what if you don't specify a module type, I meant?

carocad13:11:47

I didnt try that 😅 . Will do after I fix the java version 😉

mauricio.szabo16:12:35

I'm also interested on this change! Currently I use rewrite-cljs to parse source files, but it is kinda slow, so I'm hoping these improvements will be handy for my projects :)

carocad13:12:10

@U3Y18N0UC if you have some experience with js -> cljs I am looking for help 🙂 . I am not that experience on it but I do have a branch with a prototype that works on js but not on cljs. Any help is more than welcome