4 ms·
Doesn't Haskell use persistent data structures? If so, doesn't that directly compensate for the problem you mention? Though it is still true that a purely func
by charlieflowers 10y ago
Doesn't Haskell use persistent data structures? If so, doesn't that directly compensate for the problem you mention?
Though it is still true that a purely functional language will need to allocate more than a typical imperative language.
- harpocrates 10y agoThat does help, yes. For example, inserting into a tree only takes a logarithmic number of allocations because of the fact the subtrees are persistent. That said with every insertion/deletion into that same tree, there is still at least log(n) garbage produced, which currently has to be handled by the GC. Linear types would let us free that garbage up as soon as it is produced and without GC pauses.