Programming

32 thoughts
last posted May 6, 2017, 10:17 p.m.

17 later thoughts

1

I'm doing a talk next week about Mori the library of immutable data structures for Javascript and this week Facebook releases... a library of immutable data structures.

Cue panicked reading... fortunately both libraries have interesting areas of overlap and difference. Essentially both use hashmap tries to create immutable structures without cloning. Both appear to unify collections into sequences and their related operations. Both aim to provide simple memory-reference comparison for changes in support of virtual doms and reactive event streams. Both avoid intermediate forms an allocation during transformations.

Immutable.js is smaller in scope that Mori though with less operations available on sequences. It has also taken an object-orientated interface approach to expose the functionality on the immutable collection types. This seems to be the major point of difference so far and also seems an odd design choice as it limits its opportunity for composition.

14 earlier thoughts