Ola,
  I had some papers on A-Normal form and trampolining on the JVM (to
allow for proper tail call optimization for scheme and ml impls though
accessing the current continuation in the user code is possible) but
they seem to be lost.  The one paper compared using return sleds
(special Class instance that would be returned to the trampoline loop
capturing the frames all the way down) and exceptions (similar to the
return sled except used try/catch blocks instead).  They found that
returning to the trampoline loop every N frames (~40 was optimal at
the time) was the most efficient.  The code needed to be transformed
into A-Normal form to allow for proper capture of the current
continuation (what would be passed to the trampoline loop to unwind
the stack).  I am going to keep on searching for them and will post
the links on this thread.

Kelly

On Dec 29, 2007 9:05 AM, Ola Bini <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm looking at implementing a language that would be best represented
> using CPS. Now, I can't really find any references to full CPS
> implementations on the JVM anywhere. I'm looking at using the technique
> Kawa is planning for compiled code (see the last part at
> http://www.gnu.org/software/kawa/internals/complications.html). Has
> anyone else done this? It seems one of the natural side effects of
> something like this would be a need to have almost all primitives
> implemented in the language itself, since writing this kind of code by
> hand is a bit of a pain.
>
> Second, has anyone tried, or is it even possible to do real CPS in
> interpreted style on the JVM? It would seem as that would require at
> least TCO to work.
>
> I guess my implementation won't have any interpretation if that's the
> case. =)
>
> Cheers
>
> --
>  Ola Bini (http://ola-bini.blogspot.com)
>  JRuby Core Developer
>  Developer, ThoughtWorks Studios (http://studios.thoughtworks.com)
>  Practical JRuby on Rails (http://apress.com/book/view/9781590598818)
>
>  "Yields falsehood when quined" yields falsehood when quined.
>
>
>
> >
>



-- 
Like the fella says, in Italy for 30 years under the Borgias they had
warfare, terror, murder, and bloodshed, but they produced
Michelangelo, Leonardo da Vinci, and the Renaissance. In Switzerland
they had brotherly love - they had 500 years of democracy and peace,
and what did that produce? The cuckoo clock.
-- Orson Welles

--~--~---------~--~----~------------~-------~--~----~
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