On 04/02/2009 10:15 AM, Ola Bini wrote:
> Scala removes tail calls where it can be statically transformed into
> iteration,
> but doesn't give any guarantees.
I should have mentioned that Kawa does this too, even when not
using the full-tail-elimination calling-convention. I assume
most Scheme on-JVM implementations do the same, to at least
some degree.
> The overhead of all of these approaches are pretty severe on the JVM
> since the usage pattern is data driven and far away from how regular
> Java code looks like.
I tried the a port of binarytress from the programming languages
"shootout", but it was too quick to be able to tell the difference.
I need a more serious test program ...
> But the most severe problem with it is that all of
> these approaches make it much hard to do calls into Java methods.
Not quite sure what you mean. Kawa has no problems calling Java
methods. Of course if you want the tail-call-elimination when calling
a Java method in tail position then it gets hairy - Kawa doesn't
try that. Though it doesn't seem that difficult - you could compile the
call into a separate stub function. Or just not "inline" the method
call, so it would be handled by reflection.
--
--Per Bothner
[email protected] http://per.bothner.com/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---