Immutable data structures for functional JS
summary
Explains that persistent immutable collections use Bitmapped Vector Trie and path copying so updates copy a root-to-leaf path not the whole array converting O(n) copies into O(log n) steps and enabling structural sharing to save memory while keeping old versions. Shows hash-array-mapped tries, 32-way branching, concrete APIs and examples using Mori (conj asoc get) and Immutable.js (List/Map push set get) and reports Mori tends to be faster while Immutable.js is smaller.
AI-written summary · about
chapters (14)
- 0:00Intro
- 3:05Immutability
- 5:01Problems with mutability
- 6:41Immutable data structures
- 8:37Magic tricks
- 8:54Trees
- 10:00Path copying
- 11:36TRY trees
- 14:27Branching trees
- 15:58Bit partitioned vector
- 18:44Recap
- 20:33Immutable JS
- 24:17immutablejs
- 25:09comparison
related talks
33mImmutable data structures for functional JS
26mImmutability, interactivity & JavaScript
45mJavaScript Immutability - "Don't Go Changing"
31mImmutable Data and React
19mImmutability is Changing: From Immutable.js to Immer
01h 03mFunctional Programming in JS: What? Why? How?
30mLearning Functional Programming with JavaScript
34mFunctional Programming in JavaScript
