Hacker News new | ask | show | jobs
by eru 546 days ago
The stack is just an implementation detail of some languages.

Some other languages have non-broken function calls, and don't need to grow the stack for all of them.

In those languages, you don't need to have loops as built-in to work around broken function calls. You can just write your own loops as library functions.

(Of course, the naive recursive definition of Fibonacci would still be slow. You'd want to write a version that can be efficiently evaluated. You are already familiar with the linear time version in the iterative form.

You can also write a logarithmic time version of Fibonacci.)