Effect handlers for C via coroutines

Mario Alvarez-Picallo, Teodoro Freund, Dan R. Ghica, Sam Lindley

Research output: Contribution to journalArticlepeer-review

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.
Original languageEnglish
Article number358
Pages (from-to)2462-2489
Number of pages28
JournalProceedings of the ACM on Programming Languages
Volume8
Issue number OOPSLA2
DOIs
Publication statusPublished - 8 Oct 2024
EventThe 2024 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for Humanity - Pasadena, United States
Duration: 20 Oct 202425 Oct 2024
https://2024.splashcon.org/

Keywords / Materials (for Non-textual outputs)

  • effect handlers
  • coroutines
  • C

Fingerprint

Dive into the research topics of 'Effect handlers for C via coroutines'. Together they form a unique fingerprint.

Cite this