Proceedings of the first ACM SIGPLAN international conference on Functional programming
Final shift for call/cc:: direct implementation of shift and reset
Proceedings of the seventh ACM SIGPLAN international conference on Functional programming
Implementation Strategies for First-Class Continuations
Higher-Order and Symbolic Computation
C--: A Portable Assembly Language that Supports Garbage Collection
PPDP '99 Proceedings of the International Conference PPDP'99 on Principles and Practice of Declarative Programming
MinCaml: a simple and efficient compiler for a minimal functional language
Proceedings of the 2005 workshop on Functional and declarative programming in education
Adding delimited and composable control to a production programming environment
ICFP '07 Proceedings of the 12th ACM SIGPLAN international conference on Functional programming
Shifting the stage: staging with delimited control
Proceedings of the 2009 ACM SIGPLAN workshop on Partial evaluation and program manipulation
On typing delimited continuations: three new solutions to the printf problem
Higher-Order and Symbolic Computation
Polymorphic delimited continuations
APLAS'07 Proceedings of the 5th Asian conference on Programming languages and systems
Functional derivation of a virtual machine for delimited continuations
Proceedings of the 12th international ACM SIGPLAN symposium on Principles and practice of declarative programming
Typing control operators in the CPS hierarchy
Proceedings of the 13th international ACM SIGPLAN symposium on Principles and practices of declarative programming
Shifting the stage: Staging with delimited control
Journal of Functional Programming
Delimited control in OCaml, abstractly and concretely: system description
FLOPS'10 Proceedings of the 10th international conference on Functional and Logic Programming
Delimited control in OCaml, abstractly and concretely
Theoretical Computer Science
Higher-Order and Symbolic Computation
Hi-index | 0.00 |
Although delimited control operators are becoming one of the useful tools to manipulate flow of programs, their direct and compiled implementation in a low-level language has not been proposed so far. The only direct and low-level implementations available are Gasbichler and Sperber's implementation in the Scheme 48 virtual machine and Kiselyov's implementation in the OCaml bytecode. Even though these implementations do provide insight into how stack frames are composed, they are not directly portable to compiled implementation in assembly language. This paper presents a direct implementation of delimited control operators shift and reset in the MinCaml compiler. It shows all the details of how composable continuations can be implemented in the PowerPC microprocessor using a stack discipline. We also show an implementation that copies stack frames lazily. To our knowledge, this is the first implementation of shift/reset in assembly language. It makes clear at the assembly language level what we have informally described so far, such as "copying and composing stack frames" and "inserting a reset mark when captured continuations are called". We demonstrate various benchmarks to show the performance of our implementation and discuss its pros and cons.