Continuation Passing Style for Effect Handlers

Daniel Hillerström, S. Lindley, R. Atkey, K. Sivaramakrishnan
{"title":"Continuation Passing Style for Effect Handlers","authors":"Daniel Hillerström, S. Lindley, R. Atkey, K. Sivaramakrishnan","doi":"10.4230/LIPIcs.FSCD.2017.18","DOIUrl":null,"url":null,"abstract":"We present Continuation Passing Style (CPS) translations for Plotkin and Pretnar's effect handlers with Hillerstrom and Lindley's row-typed fine-grain call-by-value calculus of effect handlers as the source language. CPS translations of handlers are interesting theoretically, to explain the semantics of handlers, and also offer a practical implementation technique that does not require special support in the target language's runtime. \n \nWe begin with a first-order CPS translation into untyped lambda calculus which manages a stack of continuations and handlers as a curried sequence of arguments. We then refine the initial CPS translation first by uncurrying it to yield a properly tail-recursive translation and second by making it higher-order in order to contract administrative redexes at translation time. We prove that the higher-order CPS translation simulates effect handler reduction. We have implemented the higher-order CPS translation as a JavaScript backend for the Links programming language.","PeriodicalId":284975,"journal":{"name":"International Conference on Formal Structures for Computation and Deduction","volume":"125 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-09-03","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"37","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"International Conference on Formal Structures for Computation and Deduction","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.4230/LIPIcs.FSCD.2017.18","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 37

Abstract

We present Continuation Passing Style (CPS) translations for Plotkin and Pretnar's effect handlers with Hillerstrom and Lindley's row-typed fine-grain call-by-value calculus of effect handlers as the source language. CPS translations of handlers are interesting theoretically, to explain the semantics of handlers, and also offer a practical implementation technique that does not require special support in the target language's runtime. We begin with a first-order CPS translation into untyped lambda calculus which manages a stack of continuations and handlers as a curried sequence of arguments. We then refine the initial CPS translation first by uncurrying it to yield a properly tail-recursive translation and second by making it higher-order in order to contract administrative redexes at translation time. We prove that the higher-order CPS translation simulates effect handler reduction. We have implemented the higher-order CPS translation as a JavaScript backend for the Links programming language.
效果处理程序的延续传递样式
我们用Hillerstrom和Lindley的行类型细粒度按值调用的效果处理程序作为源语言,对Plotkin和Pretnar的效果处理程序进行了连续传递风格(CPS)的翻译。从理论上讲,处理程序的CPS翻译很有趣,可以解释处理程序的语义,还提供了一种实用的实现技术,不需要在目标语言的运行时中提供特殊支持。我们从一阶CPS转换为无类型lambda演算开始,它将一堆延续和处理程序作为参数的柯里化序列进行管理。然后,我们首先通过对初始CPS翻译进行解套用以产生正确的尾部递归翻译来改进初始CPS翻译,然后通过使其高阶以在翻译时收缩管理索引来改进初始CPS翻译。我们证明了高阶CPS转换模拟了效果处理器的缩减。我们已经将高阶CPS转换实现为Links编程语言的JavaScript后端。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信