Dynamic Wind for Effect Handlers
David Voigt, Philipp Schuster, Jonathan Immanuel Brachthäuser
摘要
Effect handlers offer an attractive way of abstracting over effectful computation. Moreover, languages with effect handlers usually statically track effects, which ensures the user is aware of all side effects different parts of a program might have. Similarly to exception handlers, effect handlers discharge effects by locally defining their behavior. In contrast to exception handlers, they allow for resuming computation, possibly later and possibly multiple times. In this paper we present a design, formalization, and implementation for a variant of dynamic wind that integrates well with lexical effect handlers. It has well-defined semantics in the presence of arbitrary control effects in arbitrary places. Specifically, the behavior of capturing and resuming continuations in the pre- or postlude is well-defined and respects resource bracketing. We demonstrate how these features can be used to express backtracking of external state and finalization of external resources.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Effects, capabilities, and boxes: from scope-based reasoning to type-based reasoning and back 引用了 Effects as capabilities: effect handlers and lightweight effect polymorphism
- Continuing WebAssembly with Effect Handlers 引用了 Retrofitting effect handlers onto OCaml
- Handling Exceptions and Effects with Automatic Resource Analysis 引用了 Retrofitting effect handlers onto OCaml
- Soundly Handling Linearity 引用了 Retrofitting effect handlers onto OCaml
- Soundly Handling Linearity 引用了 Continuing WebAssembly with Effect Handlers
- Soundly Handling Linearity 引用了 Effects as capabilities: effect handlers and lightweight effect polymorphism
引用它的顶会 Paper1
它引用的 Paper6
- Effects as capabilities: effect handlers and lightweight effect polymorphismJonathan Immanuel Brachthäuser, Philipp Schuster, Klaus OstermannOOPSLA 2020 · 62 次引用
- Retrofitting effect handlers onto OCamlK. C. Sivaramakrishnan, Stephen Dolan, Leo White, Tom Kelly 等PLDI 2021 · 56 次引用
- Effects, capabilities, and boxes: from scope-based reasoning to type-based reasoning and backJonathan Immanuel Brachthäuser, Philipp Schuster, Edward Lee, Aleksander Boruch-GruszeckiOOPSLA 2022 · 24 次引用
- Continuing WebAssembly with Effect HandlersLuna Phipps-Costin, Andreas Rossberg, Arjun Guha, Daan Leijen 等OOPSLA 2023 · 20 次引用
- Soundly Handling LinearityWenhao Tang, Daniel Hillerström, Sam Lindley, J. Garrett MorrisPOPL 2024 · 8 次引用
相关 Paper
- A typed continuation-passing translation for lexical effect handlersPhilipp Schuster, Jonathan Immanuel Brachthäuser, Marius Müller, Klaus OstermannPLDI 2022 · 10 次引用
- Virtualizing ContinuationsCong Ma, Jonghyun Jung, Yizhou ZhangPLDI 2026
- Zero-Overhead Lexical Effect HandlersCong Ma, Zhaoyi Ge, Max Jung, Yizhou ZhangOOPSLA 2025 · 2 次引用
- Lexical Effect Handlers, DirectlyCong Ma, Zhaoyi Ge, Edward Lee, Yizhou ZhangOOPSLA 2024 · 7 次引用
- High-level effect handlers in C++Dan R. Ghica, Sam Lindley, Marcos Maroñas Bravo, Maciej PirógOOPSLA 2022 · 14 次引用
