A dynamic continuation-passing style for dynamic delimited continuations

Research output: Contribution to journal/Conference contribution in journal/Contribution to newspaperJournal articleResearchpeer-review

  • Dariusz Biernacki, Institute of Computer Science, Instytut Astronomiczny, Uniwersytet Wroclawski, Kopernika 11, 51-622, Wroclaw, Poland
  • ,
  • Olivier Danvy
  • Kevin Millikin, Google

We put a preexisting definitional abstract machine for dynamic delimited continuations in defunctionalized form, and we present the consequences of this adjustment. We first prove the correctness of the adjusted abstract machine. Because it is in defunctionalized form, we can refunctionalize it into a higher-order evaluation function. This evaluation function, which is compositional, 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" and we present the corresponding dynamic CPS transformation. We show that the notion of computation induced by dynamic CPS takes the form of a continuation monad with a recursive answer type. This continuation monad suggests a new simulation of dynamic delimited continuations in terms of static ones. Finally, we present new applications of dynamic delimited continuations, including a meta-circular evaluator. The significance of the present work is that the computational artifacts surrounding dynamic CPS are not independent designs: they are mechanical consequences of having put the definitional abstract machine in defunctionalized form.

Original languageEnglish
Article number2
JournalA C M Transactions on Programming Languages and Systems
Volume38
Issue1
ISSN0164-0925
DOIs
Publication statusPublished - 2015

    Research areas

  • Algorithms, Languages, Theory

See relations at Aarhus University Citationformats

ID: 97988688