|
|
|
|
|
by BradSwain
466 days ago
|
|
> Any recursive function can be transformed into a tail recursive form, exchanging stack allocation for heap allocation. And any tail recursive program can be transformed into a loop (a trampoline) A computer can chug through millions of loop iterations. I don't think tail recursion will ever result in heap exhaustion. But a stack overflow can be caused with tens of thousands of nested calls, which is tiny in comparison. Recursion based stack overflow issues are easier to exploit because modern computer's stack space is much smaller relative to other resources. |
|
Sounds like a design issue in particular language implementations rather than a problem with the programming technique.