Clojure China

Some progresses on Cumulo

#1

Introductions on Cumulo: https://hashnode.com/post/diffpatch-to-sync-serverclient-in-cumulos-way-cik20gbef005c4p534bprauq3

Finally finished three packages today and released them on Clojars.

I’ve been thinking about Cumulo for more than a year and planed to write it in ClojureScript long time back. Now the first prototype is here. All the three are immature, but they should be enough for my tiny apps.

shallow-diff is a package inspired by immutable-js-diff which claimed the ideas are from Clojure. Immutable data structure is from Clojure but I barely see such thing in Clojure, which detects equality based on references rather than values. But somehow it works well in JavaScript so I thought maybe I should copy it. My package is actually slower being lack of LCS algorithm. I’ll see what I can do in the future.

cumulo-client and cumulo-server are mainly common logic code for WebSocket and changes delivering. I’ve tried Cumulo in ClojureScript for several times so I known which one should be reused and which should be defined by user. The READMEs look bad. You may browse code in these directories as examples:

https://github.com/Cumulo/cumulo-server/tree/master/compiled/app/cumulo_server
https://github.com/Cumulo/cumulo-client/tree/master/compiled/app/cumulo_client

With these packages it would be much easier to start new projects in the future(less boilerplate code to write). However, the build.boot files are quite hard to due to boot-figwheel. Maybe it can be solved in the future.

Speaking of Figwheel, Cumulo is designed with hot code swapping in mind. On server it’s hot swapping Node.js and in a browser it’s swapping the DOM. Hope that the developing experience I dreamed about is true.