A typed continuation-passing translation for lexical effect handlers
Philipp Schuster, Jonathan Immanuel Brachthäuser, Marius Müller, Klaus Ostermann
摘要
Effect handlers are a language feature which enjoys popularity in academia and is also gaining traction in industry. Programs use abstract effect operations and handlers provide meaning to them in a delimited scope. Each effect operation is handled by the dynamically closest handler. Using an effect operation outside of a matching handler is meaningless and results in an error. A type-and-effect system prevents such errors from happening. Lexical effect handlers are a recent variant of effect handlers with a number of attractive properties. Just as with traditional effect handlers, programs use effect operations and handlers give meaning to them. But unlike with traditional effect handlers, the connection between effect operations and their handler is lexical. Consequently, they typically have different type-and-effect systems. The semantics of lexical effect handlers as well as their implementations use multi-prompt delimited control. They rely on the generation of fresh labels at runtime, which associate effect operations with their handlers. This use of labels and multi-prompt delimited control is theoretically and practically unsatisfactory. Our main result is that typed lexical effect handlers do not need the full power of multi-prompt delimited control. We present the first CPS translation for lexical effect handlers to pure System F. It preserves well-typedness and simulates the traditional operational semantics. Importantly, it does so without requiring runtime labels. The CPS translation can be used to study the semantics of lexical effect handlers as well as as an implementation technique.
问 Lune
几分钟看清这篇 Paper 的位置,不用再花一下午。
Lune 能读引用它和与它最相关的顶会 Paper,讲清它说了什么、后来怎样、哪里站不住,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 7 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Lexical Effect Handlers, Directly 引用了 From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect Handlers
- Zero-Overhead Lexical Effect Handlers 引用了 Lexical Effect Handlers, Directly
- Zero-Overhead Lexical Effect Handlers 引用了 From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect Handlers
- Virtualizing Continuations 引用了 Lexical Effect Handlers, Directly
- Virtualizing Continuations 引用了 Zero-Overhead Lexical Effect Handlers
- Virtualizing Continuations 引用了 From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect Handlers
引用它的顶会 Paper7
- Lexical Effect Handlers, DirectlyCong Ma, Zhaoyi Ge, Edward Lee, Yizhou ZhangOOPSLA 2024 · 7 次引用
- From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect HandlersMarius Müller, Philipp Schuster, Jonathan Lindegaard Starup, Klaus Ostermann 等OOPSLA 2023 · 7 次引用
- Zero-Overhead Lexical Effect HandlersCong Ma, Zhaoyi Ge, Max Jung, Yizhou ZhangOOPSLA 2025 · 2 次引用
- Algebraic Effects Meet Hoare Logic in Cubical AgdaDonnacha Oisín Kidney, Zhixuan Yang, Nicolas WuPOPL 2024 · 2 次引用
- Virtualizing ContinuationsCong Ma, Jonghyun Jung, Yizhou ZhangPLDI 2026
相关 Paper
- Dynamic Wind for Effect HandlersDavid Voigt, Philipp Schuster, Jonathan Immanuel BrachthäuserOOPSLA 2025
- Modal Effect TypesWenhao Tang, Leo White, Stephen Dolan, Daniel Hillerström 等OOPSLA 2025 · 4 次引用
- Binders by day, labels by night: effect instances via lexically scoped handlersDariusz Biernacki, Maciej Piróg, Piotr Polesiuk, Filip SieczkowskiPOPL 2020 · 46 次引用
- High-level effect handlers in C++Dan R. Ghica, Sam Lindley, Marcos Maroñas Bravo, Maciej PirógOOPSLA 2022 · 14 次引用
- Effects as capabilities: effect handlers and lightweight effect polymorphismJonathan Immanuel Brachthäuser, Philipp Schuster, Klaus OstermannOOPSLA 2020 · 62 次引用
