Le 18 déc. 2009 à 22:46, John Cowan a écrit :

> On Fri, Dec 18, 2009 at 3:28 PM, Per Bothner <[email protected]> wrote:
> 
>> Tail-call optimization is not a pure optimization, as it changes the
>> semantics in a fundamental way:  It removes stack traces, which are
>> part of both observable behaviour (stack traces) and the Java security
>> architecture.  Conversely, the lack of tail-call optimization when it
>> is expected (or demanded by some [non-Java] language specification)
>> means that a program that should run in finite memory will run out of
>> stack.
> 
> Indeed.  We need to be careful to distinguish between tail-calling as
> an optimization and proper tail calling as a language feature.  We
> also need, while I'm at it, to distinguish between mere tail recursion
> and generalized tail calling.  I've been hammering on these
> terminological confusions lately; it's all too easy for people, even
> people who know better, to write "TCO" when they mean "proper tail
> calling".

I do wholeheartedly agree ; indeed for (direct) tail recursion, we need
nothing new: a goto with the first instruction of the method as the destination
does the trick.


Xavier Clerc

--

You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en.


Reply via email to