> The more I think about it the more I am certain that I would not want > JVM to have an explicit tail call bytecode instruction
The problem is that tail calls like Jon Harrop described them are often times not a simple performance optimization, but rather something the correctness of your program depends on. Like if you have Erlang-style actors that use tail recursion for their main loop, you need to guarantee that this loop is being tail-call optimized, otherwise your program won't work (= not be correct). Thus, for many interesting applications you'll need something to express that this code needs to be tail-callable, otherwise it's incorrect. Which in turn mandates that your compiler knows about it, at least for statically typed languages. Of course you could have something like a runtime annotation that basically says "if you can't tail call this, give an error". But why bother if it's perfectly possible to do this in the compiler, at least for many interesting cases? Maybe both would be needed. Regards, Martin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
