
Understanding Tail Recursion - cdl
http://blogs.msdn.com/b/chrsmith/archive/2008/08/07/understanding-tail-recursion.aspx
======
octo_t
A useful term when understanding tail recursion is "trampoline"[1], even
though most compilers don't use this, it is a very useful way of visualising
tail recursive calls.

[1] -
[https://en.wikipedia.org/wiki/Tail_call#Through_trampolining](https://en.wikipedia.org/wiki/Tail_call#Through_trampolining)

~~~
tmoertel
If anybody is interested in trampolines, I just wrote an introduction to them
that uses Python examples and includes a runtime visualization so you can see
what's happening with the stack:

[http://blog.moertel.com/posts/2013-06-12-recursion-to-
iterat...](http://blog.moertel.com/posts/2013-06-12-recursion-to-
iteration-4-trampolines.html)

~~~
taylodl
You can trampoline in JavaScript too. I showed how the performance may not be
as you expect: [http://taylodl.wordpress.com/2013/06/07/functional-
javascrip...](http://taylodl.wordpress.com/2013/06/07/functional-javascript-
tail-call-optimization-and-trampolines/)

