Biernacki, Dariusz2; Danvy, Olivier4; Millikin, Kevin Scott2
1 BRICS Basic Research in Computer Science, Faculty of Science, Aarhus University, Aarhus University2 Department of Computer Science, Faculty of Science, Aarhus University, Aarhus University3 Department of Computer Science, Science and Technology, Aarhus University4 Department of Computer Science, Science and Technology, Aarhus University
We present a new abstract machine that accounts for dynamic delimited continuations. We prove the correctness of this new abstract machine with respect to a pre-existing, definitional abstract machine. Unlike this definitional abstract machine, the new abstract machine is in defunctionalized form, which makes it possible to state the corresponding higher-order evaluator. This evaluator is in continuation+state passing style and threads a trail of delimited continuations and a meta-continuation. Since this style accounts for dynamic delimited continuations, we refer to it as `dynamic continuation-passing style.' We show that the new machine operates more efficiently than the definitional one and that the notion of computation induced by the corresponding evaluator takes the form of a monad. We also present new examples and a new simulation of dynamic delimited continuations in terms of static ones.
B R I C S Report Series, 2005, Issue RS-05-16, p. 1-26