paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Hefty Algebras: Modular Elaboration of Higher-Order Algebraic Effects

Hefty 代数:高阶代数效应的模块化精化
POPL 7(POPL)2023匹配度 2/10 · 论文属于纯编程语言理论中的代数效应与处理器设计,讨论高阶操作的模块化编码与精化,没有涉及静态分析、机器学习系统、Agentic 程序、LLM 或浮点/贝叶斯程序分析,因此与用户研究画像的核心方向基本无关。引用 9 inbox
Casper Bach Poulsen, Cas van der Rest
crossref: 2026-09-10

AI 速览

一句话:提出 Hefty 代数,将高阶操作的展开过程模块化,从而在不改接口、不重编译的情况下支持高阶代数效应的实现与精化。

代数效应与处理器因其模块性而流行:程序只依赖声明的操作接口,实现可独立定义和精化,无需修改或重编译程序。然而,接受计算作为参数的高阶操作会破坏这种模块性。已有做法把高阶操作精化为更原始效应与处理器,但这类精化通常不模块化,因为精化出的操作不属于任何效应接口。本文提出一种出乎意料简单的替代方案:将原本非模块化的高阶操作精化本身模块化,并为此引入 Hefty 代数。该方案在表达能力上达到效应与处理器领域最新工作的水平。

问题
高阶代数效应操作会破坏效应接口的模块性,使依赖这些操作的程序的实现无法在不修改或重编译的情况下被定义和精化。
方法
提出 Hefty 代数,通过对原本非模块化的高阶操作精化过程进行模块化,使精化产生的操作仍可作为效应接口的一部分被实现与精化。
评估
论文以表达能力为评估维度,论证所提方案与当前效应与处理器领域的最先进工作具有同等表达能力。
原文摘要(Abstract)

Algebraic effects and handlers is an increasingly popular approach to programming with effects. An attraction of the approach is its modularity: effectful programs are written against an interface of declared operations, which allows the implementation of these operations to be defined and refined without changing or recompiling programs written against the interface. However, higher-order operations (i.e., operations that take computations as arguments) break this modularity. While it is possible to encode higher-order operations by elaborating them into more primitive algebraic effects and handlers, such elaborations are typically not modular. In particular, operations defined by elaboration are typically not a part of any effect interface, so we cannot define and refine their implementation without changing or recompiling programs. To resolve this problem, a recent line of research focuses on developing new and improved effect handlers. In this paper we present a (surprisingly) simple alternative solution to the modularity problem with higher-order operations: we modularize the previously non-modular elaborations commonly used to encode higher-order operations. Our solution is as expressive as the state of the art in effects and handlers.

链接与引用

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

BibTeX
@article{paperbot2051,
  title = {Hefty Algebras: Modular Elaboration of Higher-Order Algebraic Effects},
  author = {Casper Bach Poulsen and Cas van der Rest},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {POPL},
  year = {2023},
  doi = {10.1145/3571255}
}