4 ms·
Pretty much anyone using a functional language or immutable data structures.
by ramchip 8y ago
Pretty much anyone using a functional language or immutable data structures.
- Sharlin 8y agoThe default immutable "list" types in current mainstream functional languages (eg. Scala, Clojure) have much better performance characteristics than naive head:tail linked lists. A typical implementation is a n-ary balanced tree where n is typically on the order of 100, making operations "effectively O(1)" and also keeping cache behavior acceptable in many common cases.
- twanvl 8y agoHaskell still uses head:tail linked lists a lot. However, a lot of effort has been spent in optimizing away the data creation entirely. For example `sum [1..100]` will not actually allocate the list in memory.