This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-19
Channels
- # aleph (8)
- # announcements (43)
- # babashka (43)
- # beginners (62)
- # calva (8)
- # cider (27)
- # clj-kondo (18)
- # cljs-dev (25)
- # cljsrn (16)
- # clojure (51)
- # clojure-europe (6)
- # clojure-nl (14)
- # clojure-spec (7)
- # clojure-uk (39)
- # clojurescript (17)
- # cursive (9)
- # datascript (12)
- # datomic (16)
- # events (1)
- # fulcro (7)
- # funcool (1)
- # graalvm (2)
- # graphql (5)
- # jobs (1)
- # juxt (6)
- # kaocha (9)
- # leiningen (11)
- # luminus (1)
- # malli (1)
- # off-topic (80)
- # other-languages (2)
- # overtone (3)
- # pedestal (5)
- # quil (1)
- # re-frame (6)
- # reagent (1)
- # reitit (4)
- # rewrite-clj (5)
- # shadow-cljs (207)
- # spacemacs (1)
- # specter (4)
- # sql (1)
- # vim (14)
- # xtdb (7)
new Domino is out with async events and triggers for generating inputs via effects https://github.com/domino-clj/domino/blob/master/CHANGES.md
ClojureScript 1.10.597 is now available! https://clojurescript.org/news/2019-11-18-release - Node REPL improvements, Google Closure JS analysis, enhanced type
> Google Closure JS analysis I saw that demoed on Apropos yesterday. Super mega awesome!
I can't find anything in the changelog about Node REPL improvements. Am I missing something?
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
@U04V15CAJ release notes contain benchmarks 🙂
@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 🙂 ?
@U0LJU20SJ I'm using rewrite-clj for parsing in clj-kondo
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)
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 ?
> 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 🙂
btw, I see antlr4 also supports generating a JS target: https://github.com/antlr/antlr4/blob/master/doc/javascript-target.md
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
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
@U0LJU20SJ The best way to discover what works is building actual tools with it.
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=>
@U04V15CAJ you need to add antlr-runtime to your deps. See usage: https://github.com/carocad/parcera#usage
it expects the class parcera.antlr.ClojureParser
to be around, which doesn't seem to be in your dep
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
> 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
major issue:
:java-source-paths ["src/java"]
this path doesn't seem to be present in your git repothose 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
is the problem with JS that you do manage to build the JS file, but you don't get it to work with CLJS?
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:
> 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
compile
probably doesn't do what you think it does, it AOTs Clojure code, it's not related to Java sources
> 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
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 :)
@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