4 ms·
Your function `f` is performing a tail-call, and since it's not allocating any new values it should run happily forever in constant space. This is a common way
by chriswarbo 3y ago
Your function `f` is performing a tail-call, and since it's not allocating any new values it should run happily forever in constant space. This is a common way to implement servers, e.g. 'serve = (request) => { respond(request); serve(next_request()); }'
Unfortunately some "poorly designed language implementations"[0] will fail to run such functions, with the "stack overflow" you mention.
[0] https://en.wikisource.org/wiki/Lambda:_The_Ultimate_GOTO https://en.wikisource.org/wiki/Lambda:_The_Ultimate_GOTO
- d-lisp 3y agoIs TCO still rejected by V8 ?