This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-13
Channels
- # adventofcode (51)
- # announcements (1)
- # babashka (7)
- # beginners (45)
- # berlin (2)
- # bristol-clojurians (1)
- # calva (38)
- # cider (2)
- # clara (25)
- # clj-kondo (2)
- # cljs-dev (25)
- # cljsrn (3)
- # clojure (112)
- # clojure-dev (6)
- # clojure-europe (5)
- # clojure-nl (1)
- # clojure-spec (15)
- # clojure-uk (93)
- # clojurescript (29)
- # clojutre (2)
- # core-async (78)
- # cursive (24)
- # datomic (29)
- # figwheel-main (1)
- # fulcro (50)
- # hugsql (1)
- # hyperfiddle (1)
- # luminus (1)
- # malli (26)
- # off-topic (40)
- # portkey (12)
- # reagent (22)
- # ring-swagger (1)
- # shadow-cljs (56)
- # spacemacs (24)
- # tools-deps (68)
I recently discovered that syntax-quotes may be nested:
``[x]
now I'm trying to wrap my head around that:
(cljs.core/vec (cljs.core/sequence (cljs.core/concat (cljs.core/list (quote cljs.user/x)))))
hmm second pass shouldn't do anything I'd think? if everything is already namespace qualified it should just return the same result?
@thheller the second one introduces a new level of unquote: https://github.com/borkdude/clj-kondo/issues/648 I've never encountered this before in code, but now someone posted an issue about this at clj-kondo
user=>
``foo
Execution error (NoClassDefFoundError) at clojure.main/main (main.java:40).
Could not initialize class clojure.lang.Compiler$CompilerException
:)cljs.user=>
``x
Unexpected error (RangeError) compiling at (<cljs repl>:1).
Maximum call stack size exceeded.
@borkdude syntax-quote needs to "explode" every sequence literals in order to support unquote-splicing
so each layer of syntax-quote "explodes" more and more sequence literals producing more and more sequence literals
yeah. in a clojure interpreter I wrote I did this using metadata, but same idea. I wasn't aware of the tools.reader impl yet 😕
the tools.reader impl of syntax-quote is mostly a 1:1 reimpl of that in LispReader.java
thanks for the pointers, now I have the proper implementation details I was looking for
Heya, I stumbled upon some suspicious output from the cljs build when testing js engines: https://travis-ci.org/mfikes/clojurescript/builds/613780247#L3156. I dug back to previous builds, and this seems to have been happening for a long while, so probably not a problem? But looks weird so thought I should raise it here.
Looking at .travis.yml
, If it weren’t for the tee
:
jsc builds/out-adv/core-advanced-test.js | tee test-out.txt
this would have returned a non-zero.I think I've seen something similar in the past
I commented about it on a jira ticket but can't find it now... but I also think at the time I didn't really understand what was happening very well
I think the important part was this
Ran 480 tests containing 19679 assertions.
0 failures, 0 errors.
Exception: ReferenceError: Can't find variable: test
builds/out-adv/core-advanced-test.js:7059:516
global code@builds/out-adv/core-advanced-test.js:7091:3
which I think corresponds to a test for https://clojurescript.org/reference/javascript-module-support
Stumbled on this TODO https://github.com/clojure/clojurescript/blob/8f38049d543b04b8da55029f140b6577e3ec245a/src/main/clojure/cljs/closure.clj#L1086 Looks like potential improvement to reduce compilation time?
I test stuff like this all the time in Clojure by hardcoding an oracle that knows all the answers for a particular test. just compile something, capture all the inputs/outputs at that point, then hard-code a map in the compiler. diff the times and see if it makes any difference.