arrow
Return

Dynamic Wind for Effect Handlers

delete2025-10-01
delete0
PRE
AI
D
David Q. Voigt *
P
Philipp Schuster
J
Jonathan Immanuel Brachthäuser
DOI:10.1145/3763155delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
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.
Keywords:
control flow
lexical effect handlers
resource management
finalization
continuations
multiple resumption
effect systems
capabilities

Journal

P
Proceedings of the ACM on Programming Languages-PACMPL
IF:
2.8
Papers:
308
Citations:
4.7K

Organization

E
eberhard karls university of tubingen
Scholars:
3.3W
Papers: 2.5W
Citations: 38
Cited Papers

Cited Papers

A Type System for Effect Handlers and Dynamic Labels
err2023-01-01
err0
PREAI
errde Vilhena,Paulo Emílio; Pottier,François
errShare
errSave
Handling Algebraic Effects
err
err0
PREAI
errPlotkin,Gordon D; Pretnar,Matija
errShare
errSave
Continuing WebAssembly with Effect Handlers
err2023-10-16
err0
PREAI
errPhipps-Costin,Luna; Rossberg,Andreas; Guha,Arjun; Leijen,Daan; Hillerström,Daniel; Sivaramakrishnan,KC; Pretnar,Matija; Lindley,Sam
errShare
errSave
Gentrification gone too far? affordable 2nd-class values for fun and (co-)effect
err2016-12-05
err0
PREAI
errOsvald,Leo; Essertel,Grégory; Wu,Xilun; Alayón,Lilliam I. González; Rompf,Tiark
errShare
errSave
Soundly Handling Linearity
err2024-01-02
err0
PREAI
errTang,Wenhao; Hillerström,Daniel; Lindley,Sam; Morris,J. Garrett
errShare
errSave
Handlers of Algebraic Effects
err2009-01-01
err0
PREAI
errPlotkin,Gordon; Pretnar,Matija
errShare
errSave
Retrofitting effect handlers onto OCaml
err2021-06-19
err0
PREAI
errSivaramakrishnan,KC; Dolan,Stephen; White,Leo; Kelly,Tom; Jaffer,Sadiq; Madhavapeddy,Anil
errShare
errSave
researcher View more