3 ms·
It's not so common because: - It requires a running JVM to compile it all down (not a bad thing). - Can take upwards of a second to compile depending on code
by film42 13y ago
It's not so common because:
- It requires a running JVM to compile it all down (not a bad thing).
- Can take upwards of a second to compile depending on code base size and compression setting (even if the JVM is warm).
- Kills all ability to debug. Looks like "a.call().call()" etc.
That said, ClojureScript has been fun to work with, but IMO, Google Closure as dependency thwarts a lot of people looking to try it out like they might try CoffeeScript or TypeScript.
- gtrak 13y agoMaybe I'm a bit of a masochist, but it's not that hard to read the compiled output, especially when you have a decent mental model of what it should be. It doesn't look like idiomatic javascript, but the structure is pretty regular. Here's an example for the kids at home. compiled: https://github.com/gtrak/node-cljs-template/blob/master/src/cljs-app.js#L13758 https://github.com/gtrak/node-cljs-template/blob/master/src/... from: https://github.com/gtrak/node-cljs-template/blob/master/src-cljs/src/cljs_app/node_bits.cljs#L4 https://github.com/gtrak/node-cljs-template/blob/master/src-...
- r4vik 13y agohttp://cljsfiddle.net/ http://cljsfiddle.net/ goes a long way towards having a tool people can just play with to try out ClojureScript without being twarted by setting up Clojure/JVM/Lein/Lein-cljsbuild/
- chii 13y agoi m certain you can pretty print the resulting compiled js. see http://googleclosure.blogspot.com.au/2010/10/pretty-print-javascript-with-closure.html http://googleclosure.blogspot.com.au/2010/10/pretty-print-ja...
- lennel 13y agoand don't forget source maps