Did you know that Emacs already supports tail-call optimisation in the bytecode interpreter? https://github.com/emacs-mirror/emacs/blob/92b3528cf3e6d366086e89b9a909f0c81614a064/src/bytecode.c#L662-L666 (me neither!)
miniblog.
Related Posts
I really like languages that store their runtime stack on the heap, such as Smalltalk.
You can write code as if you have tail call optimisation, but you still have normal stack traces for debugging.
The Self programming language, the optimisation techniques they pioneered, and the emergent design principles: https://youtube.com/watch?v=3ka4KY7TMTU
(Stanford talk by one of the creators)
Applying different profile guided optimisation techniques to the rust compiler:
