2 ms·
As long as there aren't cycles of course you can do deterministic GC, it's just reference counting. It also helps if the program is single-threaded since otherw
by astrange 5y ago
As long as there aren't cycles of course you can do deterministic GC, it's just reference counting. It also helps if the program is single-threaded since otherwise any memory allocation/freeing can be unpredictable (since it probably locks.)
- baryphonic 5y agoI've seen Prescheme (a subset of Scheme used to bootstrap a full-fledged dialect of Scheme) that seems to allow only stack-based allocation and therefore forbids certain types of closures that cannot be reduced via hoisting at compile time.[0] Lisp with ref counting (assuming acyclic references) instead of GC could also be interesting to try to hack together. I have a feeling closures would be a particularly quick way to get reference cycles, so some concept of weak references may be necessary. [0] https://thintz.com/resources/prescheme-documentation https://thintz.com/resources/prescheme-documentation