6 ms·
Could you explain why are they step ahead? I am not familiar with ClojureScript, but my interest in it is really high.
by zaynetro 11y ago
Could you explain why are they step ahead? I am not familiar with ClojureScript, but my interest in it is really high.
- alejandrodob 11y agoBecause Clojurescript uses immutable data structures, and keeps the state in a centralized atom, so comparing different states is as easy (and fast) as comparing the different versions of the data structure, which in turn (and thanks to being immutable data structures) reduces to compare their memory references, which is fast.
- Touche 11y agoNitpicking but ClojureScript the language does not keep state in a centralized atom. That's just a common pattern used for Reagent/Om apps.
- mbrock 11y agoCentralized state as an immutable data structure is exactly how the app I work with is built. It's plain JavaScript and React. So I don't see how React is "behind" on this front.
- xtrumanx 11y agoImmutable.js is a project also from FaceBook that brings immutable data structures to your JS applications including those using React. Since Clojurescript compiles down to JS, wouldn't it be possible to use Immutable.js and a slightly different app design (a single Flux Store for the entire app) to get the same benefit of using React with Clojurescript?
- lewisl9029 11y agoThe centralized immutable state oriented architecture advocated by Om can definitely be implemented using plain JavaScript (my favorite in this space is https://github.com/moreartyjs/moreartyjs https://github.com/moreartyjs/moreartyjs), but language features like core.async, transducers and macros are not so easily replicated.
- woah 11y agoNuclear.js also does this, with pretty idiomatic JavaScript
- deleted 11y ago[deleted]
- MikeOfAu 11y agoThis is a slightly long read, but it will give you a feel for it: https://github.com/Day8/re-frame https://github.com/Day8/re-frame (disclosure: I am the author)