Re:Racketscript
by cultofmetatron on Tuesday November 01, 2022 @08:04AM
(#33420067)
its the only way to do loops without blowing your call stack in scheme. technically yes as long as you're not doing anything interesting
[ Parent
| on HN ]
Currently, the compiler does a dumb conversion to JS for loop of self tail calls. So if you call `map` on list of 1000000 items, your stack wont blow up. But I understand it is not enough for many non-trivial codebases. We were interested in doing more general TCO, and had some ideas around using trampolines (or iirc detecting mutually recursions and then trying to generate potentially a bit faster code). Had limited time, and was maybe too hopeful that eventually TCO will actually be supported by browsers (as it is part of standard).