On 12/08/2009 05:39 AM, Kresten Krab Thorup wrote: > FYI, I wrote a blob on how I encode tail recursion in Erjang: > http://bit.ly/6XIma1 .
The "trampoline" mechanism you describe is basically what Kawa does when in --full-tailcalls mode - the basic idea is of course quite old. (I suspect Erland's parameter-passing is faster, as Kawa could do with some tuning here. I've concentrated on the performance of the default --no-full-tailcalls mode.) Kawa does support "state-machine semantics" where mutually recursive functions are compiled to gotos, even when in the --no-full-tailcalls mode. (This is fairly recent - it was implemented this Summer.) Rather than a single function per class, Kawa compiles multiple functions to a class, which reduces static footprint, at the cost of an extra level of indirection (but only when calling an unknown function). This link has a description of how Kawa implements functions, though it is very sparse on how tail-call-elimination works: http://www.gnu.org/software/kawa/internals/procedures.html -- --Per Bothner p...@bothner.com 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 jvm-langua...@googlegroups.com. To unsubscribe from this group, send email to jvm-languages+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en.