
ClojureScript's persistent data structures in vanilla JavaScript - DanielRibeiro
https://github.com/swannodette/mori
======
swannodette
Rationale and documentation here <http://swannodette.github.io/mori/>

Feedback welcome on what people would like to see. I prefer to use the data
structures from ClojureScript but I thought it might be interesting to provide
them to JavaScript developers. Note it's not a small dependency (~21K gzipped)
so I think people are more likely to use them from Node.

The library also provides access to Clojure style reducers as well as
Clojure's functional zippers.

I'm open to ideas about making the usage more idiomatic for JavaScript
developers - pull requests welcome.

------
danenania
Very cool. I like ClojureScript and believe that immutability is usually the
better choice, but I don't always want to deal with the Closure compiler and
somewhat involved build process. This takes some of the best qualities of
ClojureScript and makes them portable. Writing highly functional CoffeeScript
with these data structures sounds quite appealing in situations where
ClojureScript might be overkill or doesn't fit well into the stack.

~~~
python3
Use lein-cljsbuild to compile ClojureScript as soon as the file change is
made. After the intial JVM startup, compilation is instant.
<https://github.com/emezeske/lein-cljsbuild>

\-- more --

ClojureScript is the Clojure language compiler that targets JavaScript. It
compiles to Google Closure (not Clojure) JavaScript, but it can also target
NodeJS. ClojureScript lets you use Clojure in the browser, adds Clojure data
types to the JavaScript language, and allows for JavaScript to interact with
the Clojure datatypes. Here's the side by side comparison
<https://himera.herokuapp.com/synonym.html>

One of the most obvious additions to JavaScript is the ability to partition
your JavaScript with namespaces.

~~~
arkx
Definitely not instant compilation. The app I'm currently working on has 6k
lines of code and the incremental compilations take a little over 6 seconds.

~~~
swannodette
Hmm, sounds like you have a fairly large namespace instead of separate ones?

------
v0lta
Can someone with some insight tell me what ClosureScript is exactly about,
what it's for or if it's worth keeping an eye open for it? That would be
great.

I did my own research but would like to hear one or two more opinions. Thank
you.

~~~
jared314
Like Scala/Clojure on the JVM, F#/ClojureCLR on .Net, or
Coffeescript/Typescript on Javascript, it adds higher-level programming
language semantics to programs running in a browser, NodeJS, Rhino, or any
other javascript VM.

Features like namespaces, immutability, fast persistent data structures, and,
if you are already using JVM Clojure in the same application, the Clojure
language. Not to mention, the EDN data transport format, which means you can
unify the server-side language, the client-side language, and the data
transport format to Clojure (just like what javascript champions talk about
with JS, JSON, and NodeJS).

