[plt-scheme] guido on tail recursion

From: hendrik at topoi.pooq.com (hendrik at topoi.pooq.com)
Date: Fri Apr 24 21:57:41 EDT 2009

On Fri, Apr 24, 2009 at 08:53:50PM -0400, Eli Barzilay wrote:
> On Apr 24, Jordan Johnson wrote:
> > 
> > On Apr 24, 2009, at 1:31 PM, Eli Barzilay wrote:
> > > Yes.  I should also have added that control might go through
> > > several pieces of code, and most such pieces of code will do the
> > > "obvious thing" and end with tail calls -- so things just sort
> > > themselves out.  (I remember that Joe Marshall phrased this nicely
> > > at some point, I don't remember the sentence though.)
> > 
> > Well, all this points up a chasm between the Schemers' terminology
> > and Guido's: in his article he consistently used "TRE" / "tail
> > recursion", while here the conversation is about "TCO" and tail call
> > elimination.  Sounds like he's just focused on that one special
> > case.
> 
> Yes -- and that's not surprising when it's coming from someone who
> didn't internalize the benefit of general tail calls: such people
> usually think that this is just some overly sophisticated way to do
> simple loops, which are more "understandable" with state...  I think
> that Shriram's automaton thing is a good demonstration of what you can
> get with tail calls, but the problem there is that it's buried in some
> of that "macro" stuff which clearly only crazy people use.

And that was the whole point of Scheme back in the dark ages when 
tail-recursin and continuations were being used to implement various AI 
control structures and show how much more elegantly they could be done 
if built on continuation-passing.  The AI techniques were built into 
another kind of language that was implemented using tail-recursion and 
continuations.

Just like the "macro" stuff.

-- hendrik


Posted on the users mailing list.