首页    期刊浏览 2024年12月13日 星期五
登录注册

文章基本信息

  • 标题:A Functional Correspondence between Monadic Evaluators and Abstract Machines for Languages with Computational Effects
  • 本地全文:下载
  • 作者:Mads Sig Ager ; Olivier Danvy ; Jan Midtgaard
  • 期刊名称:BRICS Report Series
  • 印刷版ISSN:0909-0878
  • 出版年度:2003
  • 卷号:10
  • 期号:35
  • 出版社:Aarhus University
  • 摘要:We extend our correspondence between evaluators and abstract machines from the pure setting of the lambda-calculus to the impure setting of the computational lambda-calculus. Specifically, we show how to derive new abstract machines from monadic evaluators for the computational lambda-calculus. Starting from a monadic evaluator and a given monad, we inline the components of the monad in the evaluator and we derive the corresponding abstract machine by closure-converting, CPS-transforming, and defunctionalizing this inlined interpreter. We illustrate the construction first with the identity monad, obtaining yet again the CEK machine, and then with a state monad, an exception monad, and a combination of both. In addition, we characterize the tail-recursive stack inspection presented by Clements and Felleisen at ESOP 2003 as a canonical state monad. Combining this state monad with an exception monad, we construct an abstract machine for a language with exceptions and properly tail-recursive stack inspection. The construction scales to other monads--including one more properly dedicated to stack inspection than the state monad--and other monadic evaluators.
国家哲学社会科学文献中心版权所有