Lazy continuations for Java virtual machines

Continuations, or 'the rest of the computation', are a concept that is most often used in the context of functional and dynamic programming languages. Implementations of such languages that work on top of the Java virtual machine (JVM) have traditionally been complicated by the lack of continuations because they must be simulated. We propose an implementation of continuations in the Java virtual machine with a lazy or on-demand approach. Our system imposes zero run-time overhead as long as no activations need to be saved and restored and performs well when continuations are used. Although our implementation can be used from Java code directly, it is mainly intended to facilitate the creation of frameworks that allow other functional or dynamic languages to be executed on a Java virtual machine. As there are no widely used benchmarks for continuation functionality on JVMs, we developed synthetical benchmarks that show the expected costs of the most important operations depending on various parameters.

[1]  Brian D. Carlstrom,et al.  Embedding scheme in Java , 2000 .

[2]  Olivier Danvy,et al.  Abstracting control , 1990, LISP and Functional Programming.

[3]  Robert Hieb,et al.  Revised 5 Report on the Algorithmic Language , 1999 .

[4]  Frank Yellin,et al.  The Java Virtual Machine Specification , 1996 .

[5]  Cliff Click,et al.  The Java HotSpot Server Compiler , 2001, Java Virtual Machine Research and Technology Symposium.

[6]  Jan Vitek,et al.  Continuations in the Java Virtual Machine , 2007 .

[7]  Roberto Ierusalimschy,et al.  Revisiting coroutines , 2009, TOPL.

[8]  Jan Vitek,et al.  Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems , 2006, ECOOP Workshops.

[9]  Cliff Click,et al.  The java hotspot TM server compiler , 2001 .

[10]  Harold Abelson,et al.  Revised5 report on the algorithmic language scheme , 1998, SIGP.

[11]  Hanspeter Mössenböck,et al.  Design of the Java HotSpot#8482; client compiler for Java 6 , 2008, TACO.

[12]  R. Kent Dybvig,et al.  Revised5 Report on the Algorithmic Language Scheme , 1986, SIGP.

[13]  Robert Hieb,et al.  Representing control in the presence of first-class continuations , 1990, PLDI '90.

[14]  WimmerChristian,et al.  Design of the Java HotSpot client compiler for Java 6 , 2008 .

[15]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[16]  Matthias Felleisen,et al.  Implementation and use of the PLT scheme Web server , 2007, High. Order Symb. Comput..