Trampolines and algebraic Fibonacci in Rust
Rust does not guarantee tail call optimization. We implement a trampoline and discover that Fibonacci is not about numbers at all.
·
4 min read
Rust does not guarantee tail call optimization. We implement a trampoline and discover that Fibonacci is not about numbers at all.
Go does not support tail call optimization, so the trampoline device can be used.
Node.js does not support tail call optimization, but a trampoline has the same effect.
Recursion is not an easy concept at first, but once you understand it, it can be really beautiful.