Tracing Just-in-Time Compilation for Effects and Handlers
Marcial Gaißert, Carl Friedrich Bolz-Tereick, Jonathan Immanuel Brachthäuser
摘要
Effect handlers are a programming language feature that has recently gained popularity. They allow for nonlocal yet structured control flow and subsume features like generators, exceptions, asynchronicity, etc. However, implementations of effect handlers currently often sacrifice features to enable efficient implementations. Metatracing just-in-time (JIT) compilers promise to yield the performance of a compiler by implementing an interpreter. They record execution in a trace, dynamically detect hot loops, and aggressively optimize those using information available at runtime. They excel at optimizing dynamic control flow, which is exactly what effect handlers introduce. We present the first evaluation of tracing JIT compilation specifically for effect handlers. To this end, we developed RPython-based tracing JIT implementations for Eff, Effekt, and Koka by compiling them to a common bytecode format. We evaluate the performance, discuss which classes of effectful programs are optimized well and how our additional optimizations influence performance. We also benchmark against a baseline of state-of-the-art mainstream language implementations.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
脉络
- Retrofitting effect handlers onto OCaml 引用了 Binders by day, labels by night: effect instances via lexically scoped handlers
- Continuing WebAssembly with Effect Handlers 引用了 Retrofitting effect handlers onto OCaml
- Effects as capabilities: effect handlers and lightweight effect polymorphism 引用了 Binders by day, labels by night: effect instances via lexically scoped handlers
- Handling bidirectional control flow 引用了 Binders by day, labels by night: effect instances via lexically scoped handlers
它引用的 Paper11
- 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 次引用
- Binders by day, labels by night: effect instances via lexically scoped handlersDariusz Biernacki, Maciej Piróg, Piotr Polesiuk, Filip SieczkowskiPOPL 2020 · 46 次引用
- Continuing WebAssembly with Effect HandlersLuna Phipps-Costin, Andreas Rossberg, Arjun Guha, Daan Leijen 等OOPSLA 2023 · 20 次引用
- Handling bidirectional control flowYizhou Zhang, Guido Salvaneschi, Andrew C. MyersOOPSLA 2020 · 12 次引用
相关 Paper
- Dynamic Wind for Effect HandlersDavid Voigt, Philipp Schuster, Jonathan Immanuel BrachthäuserOOPSLA 2025
- Rows and Capabilities as Modal EffectsWenhao Tang, Sam LindleyPOPL 2026 · 1 次引用
- Efficient compilation of algebraic effect handlersGeorgios Karachalias, Filip Koprivec, Matija Pretnar, Tom SchrijversOOPSLA 2021 · 9 次引用
- High-level effect handlers in C++Dan R. Ghica, Sam Lindley, Marcos Maroñas Bravo, Maciej PirógOOPSLA 2022 · 14 次引用
- First-class names for effect handlersNingning Xie, Youyou Cong, Kazuki Ikemori, Daan LeijenOOPSLA 2022 · 11 次引用
