Hacker News new | ask | show | jobs
by yccs27 1576 days ago
> any non-tail-recursive function call can in principle be made tail-recursive through conversion to explicit continuation-passing style

This sounds great, but in the end you just construct your own call stack under the guise of chaining continuations together.

The real optimization happens when the continuations have structure, so that you can merge the composition of multiple continuations into one. And once you represent the continuation with its data, you just get "accumulator-passing style".