News for hackers. Stuff that matters.
Re:Tail Recursion by lispm on Thursday December 12, 2019 @04:47AM (#21770593)
> Tail recursion is a special way of writing recursive functions such that a compiler can optimize the recursion away and implement the algorithm as a loop instead.

Typically I think more like this: a compiler will compile the tail call into a jump-like construct. Tail recursion is then just only one application of this. The compiler won't need to recognize that it is a case of recursion or a loop. Tail call optimization (TCO) is the more general form.

See Scheme from 1976:

LAMBDA, The Ultimate Imperative, by Guy Lewis Steele Jr. and Gerald Jay Sussman, MIT AI Memo 353

https://dspace.mit.edu/bitstream/handle/1721.1/5790/AIM-353....

There are no comments on this comment yet.