Effect Handlers for C via Coroutines

Effect handlers provide a structured means for implementing user-defined, composable, and customisable computational effects, ranging from exceptions to generators to lightweight threads. We introduce libseff , a novel effect handlers library for C, based on coroutines. Whereas prior effect handler libraries for C are intended primarily as compilation targets, libseff is intended to be used directly from C programs. As such, the design of libseff parts ways from traditional effect handler implementations, both by using mutable coroutines as the main representation of pending computations, and by avoiding closures as handlers by way of reified effects. We show that the performance of libseff is competitive across a range of platforms and benchmarks.

Authors

Institutions

Publication Details

Journal
Proceedings of the ACM on Programming Languages
Published
2024-10-08
DOI
https://doi.org/10.1145/3689798
Citations
6
Primary Topic
Logic, programming, and type systems
Type
article
Field-Weighted Citation Impact
2.08
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Effect Handlers for C via Coroutines

Mario Alvarez-Picallo, Sam Lindley, Dan R. Ghica, Teodoro Freund
6 citations
Proceedings of the ACM on Programming Languages
Logic, programming, and type systems
2.08
article

Effect Handlers for C via Coroutines

Mario Alvarez-Picallo, Sam Lindley, Dan R. Ghica, Teodoro Freund
article en
6 citations

Abstract

Effect handlers provide a structured means for implementing user-defined, composable, and customisable computational effects, ranging from exceptions to generators to lightweight threads. We introduce libseff , a novel effect handlers library for C, based on coroutines. Whereas prior effect handler libraries for C are intended primarily as compilation targets, libseff is intended to be used directly from C programs. As such, the design of libseff parts ways from traditional effect handler implementations, both by using mutable coroutines as the main representation of pending computations, and by avoiding closures as handlers by way of reified effects. We show that the performance of libseff is competitive across a range of platforms and benchmarks.

Proceedings of the ACM on Programming LanguagesVol. 8(OOPSLA2)
Huawei Technologies (United Kingdom) (GB), University of Birmingham (GB), University of Edinburgh (GB)
Openalex Percentile: Top 11%
Logic, programming, and type systems
2.08
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.