Lune

PLDI2021顶会

Retrofitting effect handlers onto OCaml

K. C. Sivaramakrishnan, Stephen Dolan, Leo White, Tom Kelly, Sadiq Jaffer, Anil Madhavapeddy

摘要

Effect handlers have been gathering momentum as a mechanism for modular programming with user-defined effects. Effect handlers allow for non-local control flow mechanisms such as generators, async/await, lightweight threads and coroutines to be composably expressed. We present a design and evaluate a full-fledged efficient implementation of effect handlers for OCaml, an industrial-strength multi-paradigm programming language. Our implementation strives to maintain the backwards compatibility and performance profile of existing OCaml code. Retrofitting effect handlers onto OCaml is challenging since OCaml does not currently have any nonlocal control flow mechanisms other than exceptions. Our implementation of effect handlers for OCaml: (i) imposes a mean 1% overhead on a comprehensive macro benchmark suite that does not use effect handlers; (ii) remains compatible with program analysis tools that inspect the stack; and (iii) is efficient for new code that makes use of effect handlers.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 25 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Reachability types: tracking aliasing and separation in higher-order functional programs 引用了 Binders by day, labels by night: effect instances via lexically scoped handlers
  • Continuing WebAssembly with Effect Handlers 引用了 Compiler and runtime support for continuation marks
  • Continuing WebAssembly with Effect Handlers 引用了 High-level effect handlers in C++
  • Continuing WebAssembly with Effect Handlers 引用了 From folklore to fact: comparing implementations of stacks and continuations
  • Answer Refinement Modification: Refinement Type System for Algebraic Effects and Handlers 引用了 Binders by day, labels by night: effect instances via lexically scoped handlers
  • High-level effect handlers in C++ 引用了 Binders by day, labels by night: effect instances via lexically scoped handlers
  • Soundly Handling Linearity 引用了 Continuing WebAssembly with Effect Handlers
  • Soundly Handling Linearity 引用了 High-level effect handlers in C++
  • Soundly Handling Linearity 引用了 Binders by day, labels by night: effect instances via lexically scoped handlers
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper25

  1. Continuing WebAssembly with Effect HandlersLuna Phipps-Costin, Andreas Rossberg, Arjun Guha, Daan Leijen 等OOPSLA 2023 · 20 次引用
  2. Reachability types: tracking aliasing and separation in higher-order functional programsYuyan Bao, Guannan Wei, Oliver Bracevac, Yuxuan Jiang 等OOPSLA 2021 · 19 次引用
  3. High-level effect handlers in C++Dan R. Ghica, Sam Lindley, Marcos Maroñas Bravo, Maciej PirógOOPSLA 2022 · 14 次引用
  4. Answer Refinement Modification: Refinement Type System for Algebraic Effects and HandlersFuga Kawamata, Hiroshi Unno, Taro Sekiyama, Tachio TerauchiPOPL 2024 · 8 次引用
  5. Soundly Handling LinearityWenhao Tang, Daniel Hillerström, Sam Lindley, J. Garrett MorrisPOPL 2024 · 8 次引用

它引用的 Paper3

  1. Binders by day, labels by night: effect instances via lexically scoped handlersDariusz Biernacki, Maciej Piróg, Piotr Polesiuk, Filip SieczkowskiPOPL 2020 · 46 次引用
  2. From folklore to fact: comparing implementations of stacks and continuationsKavon Farvardin, John H. ReppyPLDI 2020 · 17 次引用
  3. Compiler and runtime support for continuation marksMatthew Flatt, R. Kent DybvigPLDI 2020 · 9 次引用

相关 Paper

  1. Efficient compilation of algebraic effect handlersGeorgios Karachalias, Filip Koprivec, Matija Pretnar, Tom SchrijversOOPSLA 2021 · 9 次引用
  2. Tracing Just-in-Time Compilation for Effects and HandlersMarcial Gaißert, Carl Friedrich Bolz-Tereick, Jonathan Immanuel BrachthäuserOOPSLA 2025
  3. Dynamic Wind for Effect HandlersDavid Voigt, Philipp Schuster, Jonathan Immanuel BrachthäuserOOPSLA 2025
  4. Handling bidirectional control flowYizhou Zhang, Guido Salvaneschi, Andrew C. MyersOOPSLA 2020 · 12 次引用
  5. Affect: An Affine Type and Effect SystemOrpheas van Rooij, Robbert KrebbersPOPL 2025 · 7 次引用
黄昏的海面,两侧是细线勾勒的悬崖