tail recursion

Tony Garnock-Jones tonyg at lshift.net
Mon May 14 15:34:40 UTC 2007


Philippe Marschall wrote:
> I thought GCC and VC++ do tail-call elimination.

In certain, very very constrained circumstances, they do, yes. It is
difficult to rely on it as a general safety property while programming,
though. There's been a lot of discussion of exactly how far GCC goes in
tail-call elimination in the context of the implementation of the
Chicken Scheme compiler. The summary is: not far enough to be a useful
target for a compiler like Chicken, because of the way C's automatic (==
stack) memory management works.

Regards,
  Tony
-- 
 [][][] Tony Garnock-Jones     | Mob: +44 (0)7905 974 211
   [][] LShift Ltd             | Tel: +44 (0)20 7729 7060
 []  [] http://www.lshift.net/ | Email: tonyg at lshift.net



More information about the Squeak-dev mailing list