BartoszMilewski/Okasaki

Persistent List destruction size limit

Opened this issue · 3 comments

Hy,

The list implementation is simple/nice but it imposes a limit on number of stored elements because of "additional effect" of recursive destruction. A garbage collector would be very nice indeed, without it I don't know if using a "production persistent List" is really possible.

Either garbage collection, or tail recursion optimization would fix the problem. But there are many problems in which the length of the list is bounded -- as in the eight queen problem. Also, there are alternatives to lists -- tree-like structures.

Does this issue also extend to other data structures besides lists in this library?

This library should be treated as a proof of concept. I was worried more about correctness and ease of use (especially in backtracking algorithms) than about performance.

It also points out at inherent shortcomings of C++. Contrary to popular belief, C++ is not an optimal implementation language for a whole slew of very useful data structures and algorithms.