|
|
|
|
|
by jaked89
2488 days ago
|
|
The problem with immutability in a rapidly mutating environment is that the theory clashes with reality. Anytime a leaf node changes, all its ancestors have to be replaced, instead of just updating the leaf in place. (I'm aware of the red-black node separation, but I believe that in practice most of the tree is constantly regenerated all the time). I realized it when trying to write a complex analyzer. I had to replace the tree all the way up to the project level.
If you combine different chunks of the tree, each with a slight change, you're forced to recreate each of those chunks. This is extremely wasteful, and no wonder the IDE behaves so poorly. |
|