What are some alternatives to tracing GC for dynamically-typed languages?
I've been interested in dynamically typed languages with predictable behavior since learning about lua in the NetBSD kernel. AFAICT, NetBSD's lua interpreter was intended just to prototype drivers. But it does make me wonder how much of an operating system could reasonably be implemented in a dynamically typed language (without using special hardware like a lisp machine).
I'm aware of essentially three or four mainstream memory management strategies for dynamically typed languages:
- no memory management (e.g. Forth)
- a closed type system with strings and aggregates of strings (e.g. Awk, Bash, Perl 4)
- reference counts and no cycle detection (e.g. Perl 5)
- tracing GC (e.g. Lisp, Python, Javascript)
Although I guess that technically (2) could be implemented by copying strings, with reference counts, or with some combination of the two. In either case, the difference between 2 and 3 is that 2 makes circular references impossible to express.
I'm wondering what alternatives there are to these strategies, especially ones that would have deterministic lifetimes and no pauses.
One could imagine a Lisp-Rust Frankenstein that has lifetimes as the sole component of its type system, although I'm not sure what the details would look like (and whether this would violate the spirit of a dynamically typed language).
One could also imagine a language that copies all the time.