Lune

PLDI2022Top-tier venue

A typed continuation-passing translation for lexical effect handlers

Philipp Schuster, Jonathan Immanuel Brachthäuser, Marius Müller, Klaus Ostermann

Abstract

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.

Ask Lune

Know where this paper stands in minutes, not an afternoon.

Lune can read the top-tier papers that cite it and the ones closest to it, and tells you what it claims, what came after and where it falls short, each point cited to the paper it comes from. No skimming, no AI slop.

7 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

its abstract · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Lexical Effect Handlers, Directly cites From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect Handlers
  • Zero-Overhead Lexical Effect Handlers cites Lexical Effect Handlers, Directly
  • Zero-Overhead Lexical Effect Handlers cites From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect Handlers
  • Virtualizing Continuations cites Lexical Effect Handlers, Directly
  • Virtualizing Continuations cites Zero-Overhead Lexical Effect Handlers
  • Virtualizing Continuations cites From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect Handlers
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers7

  1. Lexical Effect Handlers, DirectlyCong Ma, Zhaoyi Ge, Edward Lee, Yizhou ZhangOOPSLA 2024 · 7 citations
  2. From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect HandlersMarius Müller, Philipp Schuster, Jonathan Lindegaard Starup, Klaus Ostermann et al.OOPSLA 2023 · 7 citations
  3. Zero-Overhead Lexical Effect HandlersCong Ma, Zhaoyi Ge, Max Jung, Yizhou ZhangOOPSLA 2025 · 2 citations
  4. Algebraic Effects Meet Hoare Logic in Cubical AgdaDonnacha Oisín Kidney, Zhixuan Yang, Nicolas WuPOPL 2024 · 2 citations
  5. Virtualizing ContinuationsCong Ma, Jonghyun Jung, Yizhou ZhangPLDI 2026

Related papers

  1. Dynamic Wind for Effect HandlersDavid Voigt, Philipp Schuster, Jonathan Immanuel BrachthäuserOOPSLA 2025
  2. Modal Effect TypesWenhao Tang, Leo White, Stephen Dolan, Daniel Hillerström et al.OOPSLA 2025 · 4 citations
  3. Binders by day, labels by night: effect instances via lexically scoped handlersDariusz Biernacki, Maciej Piróg, Piotr Polesiuk, Filip SieczkowskiPOPL 2020 · 46 citations
  4. High-level effect handlers in C++Dan R. Ghica, Sam Lindley, Marcos Maroñas Bravo, Maciej PirógOOPSLA 2022 · 14 citations
  5. Effects as capabilities: effect handlers and lightweight effect polymorphismJonathan Immanuel Brachthäuser, Philipp Schuster, Klaus OstermannOOPSLA 2020 · 62 citations
Dusk over the sea between two cliffs drawn in fine vertical lines