Hacker News new | ask | show | jobs
by catnaroek 3570 days ago
Is it possible to make truly persistent data structures in Lisp, rather than just persistent by convention? Here are some benefits that you can only get if the language implementation knows your data structures are immutable:

(0) The compiler can automatically perform optimizations like fusing small nodes and hash consing.

(1) The garbage collector can take advantage of the fact that traversing (the immutable portion of) the heap sequentially produces a topological sorting of the object graph.