3 ms·
Pretty sure Om[1] for React Native is coming. >bloated code sizes, interop issues, poor runtime performance, etc I've heard about no such problems about Cloju
by danabramov 12y ago
Pretty sure Om[1] for React Native is coming.
>bloated code sizes, interop issues, poor runtime performance, etc
I've heard about no such problems about ClojureScript. In fact there's less code size than you'd usually have because Google Closure Compiler advanced more works with it out of the box[2]. It's also fast because immutability.
[1]: https://github.com/omcljs/om https://github.com/omcljs/om
[2]: http://swannodette.github.io/2015/01/06/the-false-promise-of-javascript-microlibs/ http://swannodette.github.io/2015/01/06/the-false-promise-of...
- saosebastiao 12y agoI like Clojurescript in general, but the code bloat problems and runtime speed problems still exist even with advanced optimizations. The big problem is that you have to use code that is Closure-compatible. If it isn't, there are hacks to make it work, but you end up killing the ability to remove dead code. And no matter what, you are going to end up shipping portions of the Clojure code as a runtime within the javascript runtime. I have used cljs for non-mobile web interfaces, but the performance of Om in Phonegap on mobile hardware was terrible enough that I scrapped it for Xamarin.
- Touche 12y agoFirst, all ClojureScript code is Closure compatible, you don't have to worry about that. Secondly, Om in a Webview and Xamarin are not fair comparisons.
- adrianm 12y agoOm is fast at checking if a component's state has changed because you can do a very fast identity comparison on the persistent hash map holding state, but persistent data structures are not faster than their mutable cousins simply because of immutability. That immutability leads to significantly more objects being allocated, which means to really take advantage of these features in a managed language you need a VM with a very high performance garbage collector. This is partly why Clojure on the JVM works so well. That being said, non JIT compiled JavaScript VMs generally provide terrible performance for ClojureScript. I do not believe JavaScriptCore JITs anything, so I don't know how immediately useful ClojureScript with React Native will be outside of toy examples.
- danabramov 12y agoFair points.
- amccloud 12y ago> That immutability leads to significantly more objects being allocated What about shared immutable data structures?
- tree_of_item 12y agoClojure uses structural sharing of course, but that was taken in to account in the parent comment. It's still a lot of allocation.