VictorTaelin / abstract-algorithm

Optimal evaluator of λ-calculus terms.
265 stars 16 forks source link

Improve memory allocation and deallocation strategy. #12

Open Kesanov opened 6 years ago

Kesanov commented 6 years ago

The memory representation can become very sparse after while. You can evaluate 200 with --dump to see for yourself. This memory won't be deallocated until the program ends. Thus huge space leak will occur if we allocate a lot at the beginning...

Building the interaction net lazily might be a good idea.

VictorTaelin commented 6 years ago

I do not understand the problem, or how evaluating 200 shows the problem. I understand some complain about space leaks on this algorithm, but I guess it is not the same thing of space leaks I know from Haskell, so I'd need a more precise explanation.

VictorTaelin commented 6 years ago

For example, here are some descriptions of memory leak scenarios we have due to Haskell's lazy evaluation.