A functional correspondence between monadic evaluators and abstract machines for languages with computational effects (2005)
Cached
Download Links
- [cdc.ioc.ee]
- [www.brics.dk]
- [www.brics.dk]
- DBLP
Other Repositories/Bibliography
| Venue: | Theoretical Computer Science |
| Citations: | 34 - 19 self |
BibTeX
@ARTICLE{Ager05afunctional,
author = {Mads Sig Ager and Olivier Danvy and Jan Midtgaard},
title = {A functional correspondence between monadic evaluators and abstract machines for languages with computational effects},
journal = {Theoretical Computer Science},
year = {2005},
volume = {342},
pages = {04--28}
}
Years of Citing Articles
OpenURL
Abstract
Abstract. We extend our correspondence between evaluators and abstract machines from the pure setting of the λ-calculus to the impure setting of the computational λ-calculus. We show how to derive new abstract machines from monadic evaluators for the computational λ-calculus. Starting from (1) a generic evaluator parameterized by a monad and (2) a monad specifying a computational effect, we inline the components of the monad in the generic evaluator to obtain an evaluator written in a style that is specific to this computational effect. We then derive the corresponding abstract machine by closure-converting, CPS-transforming, and defunctionalizing this specific evaluator. We illustrate the construction with the identity monad, obtaining yet again the CEK machine, and with a lifted state monad, obtaining a variant of the CEK machine with error and state. In addition, we characterize the tail-recursive stack inspection presented by Clements and Felleisen at ESOP 2003 as a lifted state monad. This enables us to combine the stackinspection monad with other monads and to construct abstract machines for languages with properly tail-recursive stack inspection and other computational effects. The construction scales to other monads—including one more properly dedicated to stack inspection than the lifted state monad—and other monadic evaluators. Keywords. Lambda-calculus, interpreters, abstract machines, closure conversion, transformation into continuation-passing style (CPS), defunctionalization, monads, effects, proper







