当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Explicit Effect Subtyping
arXiv - CS - Programming Languages Pub Date : 2020-05-28 , DOI: arxiv-2005.13814
Georgios Karachalias, Matija Pretnar, Amr Hany Saleh, Stien Vanderhallen, Tom Schrijvers

As popularity of algebraic effects and handlers increases, so does a demand for their efficient execution. Eff, an ML-like language with native support for handlers, has a subtyping-based effect system on which an effect-aware optimizing compiler could be built. Unfortunately, in our experience, implementing optimizations for Eff is overly error-prone because its core language is implicitly-typed, making code transformations very fragile. To remedy this, we present an explicitly-typed polymorphic core calculus for algebraic effect handlers with a subtyping-based type-and-effect system. It reifies appeals to subtyping in explicit casts with coercions that witness the subtyping proof, quickly exposing typing bugs in program transformations. Our typing-directed elaboration comes with a constraint-based inference algorithm that turns an implicitly-typed Eff-like language into our calculus. Moreover, all coercions and effect information can be erased in a straightforward way, demonstrating that coercions have no computational content. Additionally, we present a monadic translation from our calculus into a pure language without algebraic effects or handlers, using the effect information to introduce monadic constructs only where necessary.

中文翻译:

显式效果子类型

随着代数效应和处理程序的普及,对其高效执行的需求也在增加。Eff 是一种对处理程序提供本机支持的类 ML 语言,具有基于子类型的效果系统,可以在该系统上构建效果感知优化编译器。不幸的是,根据我们的经验,为 Eff 实现优化过于容易出错,因为它的核心语言是隐式类型的,使得代码转换非常脆弱。为了解决这个问题,我们为具有基于子类型的类型和效果系统的代数效果处理程序提供了一个显式类型的多态核心演算。它通过见证子类型证明的强制来具体化对显式转换中的子类型的呼吁,快速暴露程序转换中的类型错误。我们的类型导向细化带有基于约束的推理算法,该算法将隐式类型的 Eff 类语言转换为我们的微积分。此外,所有强制和效果信息都可以直接删除,证明强制没有计算内容。此外,我们提出了从微积分到纯语言的 monadic 翻译,没有代数效应或处理程序,仅在必要时使用效应信息引入 monadic 结构。
更新日期:2020-06-10
down
wechat
bug