proper tail calls

Brendan Eich brendan at mozilla.org
Tue Jan 22 13:37:46 PST 2008


On Jan 22, 2008, at 11:51 AM, Neil Mix wrote:

>> But why won't we feel it, as trace-readers, just as much when the
>> PTCs were explicit? This, I don't follow. The programmer and the
>> debugger-driver are often very different people, in general skills,
>> familiarity with the source at hand, etc.
>
> We will, but the point is: you (or someone you work with) made the
> decision that the benefit was worth the risk.

On the www, everyone is my colleague. I'm not kidding (have to talk  
to management about the quality of hiring lately :-P).

> Implicit PTC turns
> that choice into an irreversible default.  I'm not worried about
> those who choose to use it, I'm worried about those who'd like to
> choose not to.

The program will diverge if someone chooses not to implement PTC, so  
it's going to be required. The confusing traces and debugging views  
of the stack (which is not a program history!) can be mitigated.

But to your point, I think the party of the first part (the  
programmer who wrote code that uses tail calls) must prevail, whether  
or not they intended tail calls or expressed them explicitly. Lars  
made this point recently: unless we ban implicit PTC even when not  
elected by the programmer using explicit syntax, code will come to  
depend on PTC and we'll need it implicitly "on" everywhere. All that  
remains is the assertion.

/be



More information about the Es4-discuss mailing list