当前位置: X-MOL 学术J. Funct. Program. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
On the expressive power of user-defined effects: Effect handlers, monadic reflection, delimited control
Journal of Functional Programming ( IF 1.1 ) Pub Date : 2019-10-08 , DOI: 10.1017/s0956796819000121
YANNICK FORSTER , OHAD KAMMAR , SAM LINDLEY , MATIJA PRETNAR

We compare the expressive power of three programming abstractions for user-defined computational effects: Plotkin and Pretnar’s effect handlers, Filinski’s monadic reflection, and delimited control. This comparison allows a precise discussion about the relative expressiveness of each programming abstraction. It also demonstrates the sensitivity of the relative expressiveness of user-defined effects to seemingly orthogonal language features. We present three calculi, one per abstraction, extending Levy’s call-by-push-value. For each calculus, we present syntax, operational semantics, a natural type-and-effect system, and, for effect handlers and monadic reflection, a set-theoretic denotational semantics. We establish their basic metatheoretic properties: safety, termination, and, where applicable, soundness and adequacy. Using Felleisen’s notion of a macro translation, we show that these abstractions can macro express each other, and show which translations preserve typeability. We use the adequate finitary set-theoretic denotational semantics for the monadic calculus to show that effect handlers cannot be macro expressed while preserving typeability either by monadic reflection or by delimited control. Our argument fails with simple changes to the type system such as polymorphism and inductive types. We supplement our development with a mechanised Abella formalisation.

中文翻译:

关于用户定义效果的表现力:效果处理程序、单子反射、定界控制

我们比较了用户定义的计算效果的三种编程抽象的表达能力:Plotkin 和 Pretnar 的效果处理程序、Filinski 的一元反射和定界控制。这种比较允许对每个编程抽象的相对表达性进行精确讨论。它还展示了用户定义效果的相对表达性对看似正交的语言特征的敏感性。我们提出了三个演算,每个抽象一个,扩展了 Levy 的 call-by-push-value。对于每个演算,我们提出语法、操作语义、自然类型和效果系统,以及对于效果处理程序和单子反射,集合论指称语义。我们建立了它们的基本元理论属性:安全性、终止性,以及在适用的情况下的健全性和充分性。使用 Felleisen 的宏翻译概念,我们表明这些抽象可以相互宏表达,并显示哪些翻译保留了可类型性。我们为一元演算使用了足够的有限集合论指称语义来表明效果处理程序不能被宏观表达,同时通过一元反射或定界控制来保持可类型性。我们的论点因对类型系统(例如多态性和归纳类型)的简单更改而失败。我们用机械化的 Abella 形式化来补充我们的开发。我们为一元演算使用了足够的有限集合论指称语义来表明效果处理程序不能被宏观表达,同时通过一元反射或定界控制来保持可类型性。我们的论点因对类型系统(例如多态性和归纳类型)的简单更改而失败。我们用机械化的 Abella 形式化来补充我们的开发。我们为一元演算使用了足够的有限集合论指称语义来表明效果处理程序不能被宏观表达,同时通过一元反射或定界控制来保持可类型性。我们的论点因对类型系统(例如多态性和归纳类型)的简单更改而失败。我们用机械化的 Abella 形式化来补充我们的开发。
更新日期:2019-10-08
down
wechat
bug