1. Clojure(Script) is designed with a world-view in mind - that of preferring immutability and making mutability explicit. JavaScript is mutable. Libraries etc. are providing immutability but the language's world-view still shines through. 2. Clojure's syntax is a joy to use. JavaScripts is very verbose. 3. Macros and homoiconicity is pretty close to a perfect implementation of the Open/Closed principle. 4. Functional languages are opinionated and built around a core set of principles. Most libraries and solutions use the same set of tools. JavaScript is nowhere near as opinionated and sure there are libraries, but libraries you use won't all share the same set of principles. 5. REPL (although JavaScript has the ultimate REPL but it isn't as integrated with the IDE as a Clojure(Script) REPL. 6. Clojure all the way up. We use om on the frontend, Clojure on the backend, talk edn between the two (no more JSON conversions - yeah!), garden to generate CSS and hiccup and sablono to generate HTML. We use clojure.test and clojurescript.test (API compatible) and cljx to share code. 7. I got bored with the Java/CoffeeScript stack and wanted to live on the bleeding edge a bit.
Ultimately, I think the comparison is a little apples and oranges. It comes down to how you view the world and want to solve problems. OO versus function, mutable versus immutable. Sure, somebody could respond with "well, you can do that in JavaScript with X" but Clojure was designed from day 1 with a set of opinions that shine through, which makes it a lovely place to be. (If you are going to use JavaScript I highly recommend CoffeeScript). On Monday, 12 January 2015 17:45:13 UTC, debugging data wrote: > Vanilla Javascript has generators which allow for CSP [1], macro support [2], > and immutable collections [3]. What are the advantages of using Clojurescript > compared to Javascript? > > --- > [1] https://github.com/ubolonton/js-csp > [2] https://github.com/mozilla/sweet.js > [3] https://github.com/swannodette/mori -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
