3 ms·
For a long time, I assumed the recursive tail call optimization was a really smart optimization done by the compiler to transform a normal recursive call into a
by ww520 15y ago
For a long time, I assumed the recursive tail call optimization was a really smart optimization done by the compiler to transform a normal recursive call into a tall call. I was trying to figure out how a compiler could do that.
Then later I learned that the optimization part is really done by human to transform the recursive call into a tail call. The "optimization" done by the compiler is relatively trivial in reusing the stack frame for the last function call.
- Drbble 15y agohttp://www.owlnet.rice.edu/~comp210/96spring/Labs/lab09.html http://www.owlnet.rice.edu/~comp210/96spring/Labs/lab09.html (search for ""omatic".) The author seems to use automatic" to mean "mindless human", though, not "mindful computer"