3 ms·
ClojureScript does indeed have macros. They are compiler macros. You can't define macros in your ClojureScript file (because ClojureScript doesn't itself have a
by swannodette 15y ago
ClojureScript does indeed have macros. They are compiler macros. You can't define macros in your ClojureScript file (because ClojureScript doesn't itself have access to the compiler) but you can refer to macros defined in a Clojure file and the ClojureScript compiler will use this to expand your ClojureScript. That's what refer-macros is for. I'm looking forward to getting my pattern matching library, https://github.com/swannodette/match https://github.com/swannodette/match, working with ClojureScript.
As far as the compile times you should checkout Chris Granger's https://github.com/ibdknox/cljs-watch https://github.com/ibdknox/cljs-watch. This is analogous to "coffee -wc *.coffee".
Nice writeup.
- benatkin 15y agoTo me it was obvious that the time-to-compile measurement for ClojureScript was all wrong. It's a common, but annoying mistake people who aren't used to the JVM make. Startup Time != Compile Time.
- DanielRibeiro 15y agoIf it started once and watched files for changes, it would only be the compile time (which, if fast, would be great). As it is, the total time is the only one that counts, as it is the one that affects your productivity. JRuby guys were so aware of this that they actively promoted nailgun[1]. [1] http://www.martiansoftware.com/nailgun/ http://www.martiansoftware.com/nailgun/
- swannodette 15y agoCORRECTION: it's require-macros not refer-macros.