4 ms·
TCO is cool. I remember how enlightening it felt when I studied Scheme and came to understand how it's implemented there.
by jart 3y ago
TCO is cool. I remember how enlightening it felt when I studied Scheme and came to understand how it's implemented there.
- deredede 3y agoIf this is not what you're referring to, you might be interested in CHICKEN Scheme's implementation, which is unlike any other I've seen: instead of compiling tail calls to jumps, they are just regular calls, and the call stack is effectively garbage collected when it would overflow.
- jtlasdfjwfasdf 3y agoAgreed. Scheme taught me that function invocations didn't have to be sullied with the risk of stackoverflow, and in-fact what appeared to be recursive was actually iteration and loop constructs were not needed.