Affiliation:
1. University of Hong Kong, China
2. Microsoft Research, USA
Abstract
This paper studies compilation techniques for algebraic effect handlers. In particular, we present a sequence of refinements of algebraic effects, going via multi-prompt delimited control, _generalized evidence passing_, yield bubbling, and finally a monadic translation into plain lambda calculus which can be compiled efficiently to many target platforms. Along the way we explore various interesting points in the design space. We provide two implementations of our techniques, one as a library in Haskell, and one as a C backend for the Koka programming language. We show that our techniques are effective, by comparing against three other best-in-class implementations of effect handlers: multi-core OCaml, the _Ev.Eff_ Haskell library, and the libhandler C library. We hope this work can serve as a basis for future designs and implementations of algebraic effects.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
13 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Stack-Copying Delimited Continuations for Scala Native;Proceedings of the 19th ACM International Workshop on Implementation, Compilation, Optimization of OO Languages, Programs and Systems;2024-09-13
2. Continuing WebAssembly with Effect Handlers;Proceedings of the ACM on Programming Languages;2023-10-16
3. From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect Handlers;Proceedings of the ACM on Programming Languages;2023-10-16
4. Tail Recursion Modulo Context: An Equational Approach;Proceedings of the ACM on Programming Languages;2023-01-09
5. High-level effect handlers in C++;Proceedings of the ACM on Programming Languages;2022-10-31