paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Abstracting algebraic effects

抽象化代数效应
POPL 3(POPL)2019匹配度 1/10 · 论文属于编程语言中代数效应、handler 与类型系统/语言特性设计,与用户关注的静态分析、ML/Agent 程序分析、浮点程序分析、贝叶斯程序分析及 LLM 交叉均无直接关联。引用 31 inbox
Dariusz Biernacki, Maciej Piróg, Piotr Polesiuk, Filip Sieczkowski
crossref: 2026-09-10

AI 速览

一句话:提出 λ_HEL 演算及存在/局部代数效应,用类型化运行时强制转换保障效应抽象不被破坏。

代数效应与处理器是当前函数式语言中处理异常、可变状态、非确定性等计算效应的前沿方法,但要在大型模块化程序中推广,需要能隐藏或隔离效应的抽象机制。本文提出两种机制:存在效应(向用户隐藏特定效应细节)与局部效应(保证外部代码无法干扰给定效应)。技术难点在于执行期效应操作与正确处理器的动态耦合;作者设计了带局部与存在代数效应的 λ_HEL 演算,并用类型化运行时强制转换约束处理器的动态行为,使类型系统保证抽象不被破坏。作为概念验证,他们实现了基于该演算的实验语言,以 ML 风格模块系统提供强抽象机制。

问题
如何为代数效应与处理器提供模块化抽象机制,使大型函数式程序能隐藏效应细节并防止外部代码干扰局部效应?
方法
提出存在效应与局部效应两种构造,并设计 λ_HEL 演算;其中类型系统与类型化运行时强制转换共同管理效应操作与处理器的动态耦合。
评估
以概念验证方式实现基于 λ_HEL 的实验语言,并通过 ML 风格模块系统展示强抽象机制;评估主要依赖演算设计与原型语言。
原文摘要(Abstract)

Proposed originally by Plotkin and Pretnar, algebraic effects and their handlers are a leading-edge approach to computational effects: exceptions, mutable state, nondeterminism, and such. Appreciated for their elegance and expressiveness, they are now progressing into mainstream functional programming languages. In this paper, we introduce and examine programming language constructs that back adoption of programming with algebraic effects on a larger scale in a modular fashion by providing mechanisms for abstraction. We propose two such mechanisms: existential effects (which hide the details of a particular effect from the user) and local effects (which guarantee that no code coming from the outside can interfere with a given effect). The main technical difficulty arises from the dynamic nature of coupling an effectful operation with the right handler during execution, but, as we show in this paper, a carefully designed type system can ensure that this will not break the abstraction. Our main contribution is a novel calculus for algebraic effects and handlers, called λ HEL , equipped with local and existential algebraic effects, in which the dynamic nature of handlers is kept in check by typed runtime coercions. As a proof of concept, we present an experimental programming language based on our calculus, which provides strong abstraction mechanisms via an ML-style module system.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot678,
  title = {Abstracting algebraic effects},
  author = {Dariusz Biernacki and Maciej Piróg and Piotr Polesiuk and Filip Sieczkowski},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {3},
  number = {POPL},
  year = {2019},
  doi = {10.1145/3290319}
}