3 ms·
One focuses on the learning aspects rather than creating a production lisp. If you want a production lisp, there are plenty out there. And regardless, adding T
by capableweb 4y ago
One focuses on the learning aspects rather than creating a production lisp. If you want a production lisp, there are plenty out there.
And regardless, adding TCO is relatively simple as well, so not exactly a hard problem to figure out after you've written the first version of your toy lisp.
- busterarm 4y agoWe're talking about Lisp in Python here. Python itself famously[1,2] refuses to have TCO. 1: http://neopythonic.blogspot.com/2009/04/tail-recursion-elimination.html http://neopythonic.blogspot.com/2009/04/tail-recursion-elimi... 2: http://neopythonic.blogspot.com/2009/04/final-words-on-tail-calls.html http://neopythonic.blogspot.com/2009/04/final-words-on-tail-...
- Xophmeister 4y agoYou can implement TCO in Python manually with continuation-passing style and trampolines.
- capableweb 4y agoHere is a lisp implementation (mal) with TCO, written in Python: - https://github.com/kanaka/mal/blob/master/impls/python/step5_tco.py https://github.com/kanaka/mal/blob/master/impls/python/step5... - Theory: https://github.com/kanaka/mal/blob/master/process/guide.md#step-5-tail-call-optimization https://github.com/kanaka/mal/blob/master/process/guide.md#s...