3 ms·
I hear this a lot, but it totally mystifies me. You lose all the good parts of clojure when you go into the js runtime; stm, parallel processing, java interop,
by shadowmint 10y ago
I hear this a lot, but it totally mystifies me.
You lose all the good parts of clojure when you go into the js runtime; stm, parallel processing, java interop, hot reloading, and it pulls in some really quite large js dependencies, and it's impossible to debug. Even console logging becomes a case of 'convert to readable object and log' using special helpers.
What's the benefit?
I don't see any meaningful reason to use clojure in this context; what's the draw? Why would you bother over any other compiles-to-js language?
You.. just like the syntax? That's the best answer I've gotten so far.
- chrisoakman 10y agoI'm not sure when your last exposure to the ClojureScript ecosystem was, but almost nothing you mention is a problem as of 2016: debugging, hot reloading, large JS deps, etc. I'm biased, but I think ClojureScript is the best way to use the JavaScript platform today. Awesome core library, consistent build process, best of breed tooling, persistent data structures, flexible syntax (JSX is madness compared to hiccups); I could go on. JavaScript the platform may have it's warts, but ClojureScript is all beauty :)
- bootload 10y ago"I'm biased, but I think ClojureScript is the best way to use the JavaScript platform today. ... JavaScript the platform may have it's warts, but ClojureScript is all beauty :)" I've been slow to this, but yes this summarises why this particular language is good to use as a better JavaScript.
- shadowmint 10y agoGot a link with specifics? I've never seen breakpoints & source maps working properly; just a series of blog posts by various people who've tried and failed to get it working.
- iLemming 10y agoThat's like 2 years ago. Source maps work fairly well today.
- shadowmint 10y agocome on, dont just wave your hands in the air and say its all good. how do you do it then?
- iLemming 10y agoWhat do you mean how? Clojurescript compiler today has four different, well documented options related to source maps: https://github.com/clojure/clojurescript/wiki/Compiler-Options#source-map-timestamp https://github.com/clojure/clojurescript/wiki/Compiler-Optio... Just yesterday I placed `(js* "debugger;")` in my .cljs code and it stopped exactly where I wanted it. And showed exact piece of Clojurescript (not compiled JS)
- BWStearns 10y agoYou don't lose hot reloading. Use figwheel.
- bootload 10y ago"You lose all the good parts of clojure when you go into the js runtime;" Easy, develop one language, ship using another to the largest user base. "You.. just like the syntax?" Code as data, macros, immutability, concurrency, access to libraries.
- cgdub 10y agoIf you're developing a web app, you can share code between the frontend and backend and still use the JVM on the backend.
- TheSmoke 10y agoi am building a browser plugin with clojurescript and reagent. i could not be happier. i have easy js interop, i have hot reloading, i have easy state management, i have code optimizations thanks to direct integration to google closure compiler.
- TheSmoke 10y agoalso, here's a really good introduction to clojurescript with reagent: https://www.youtube.com/watch?v=wq6ctyZBb0A https://www.youtube.com/watch?v=wq6ctyZBb0A