Affiliation:
1. Microsoft Research, USA
2. University of Tübingen, Germany
3. University of Edinburgh, UK
Abstract
Algebraic effect handlers are a powerful way to incorporate effects in a programming language. Sometimes perhaps even _too_ powerful. In this article we define a restriction of general effect handlers with _scoped resumptions_. We argue one can still express all important effects, while improving reasoning about effect handlers. Using the newly gained guarantees, we define a sound and coherent evidence translation for effect handlers, which directly passes the handlers as evidence to each operation. We prove full soundness and coherence of the translation into plain lambda calculus. The evidence in turn enables efficient implementations of effect operations; in particular, we show we can execute tail-resumptive operations _in place_ (without needing to capture the evaluation context), and how we can replace the runtime search for a handler by indexing with a constant offset.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
22 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Parallel Algebraic Effect Handlers;Proceedings of the ACM on Programming Languages;2024-08-15
2. Abstracting Effect Systems for Algebraic Effect Handlers;Proceedings of the ACM on Programming Languages;2024-08-15
3. An Intrinsically Typed Compiler for Algebraic Effect Handlers;Proceedings of the 2024 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation;2024-01-11
4. Effectful Software Contracts;Proceedings of the ACM on Programming Languages;2024-01-05
5. From Capabilities to Regions: Enabling Efficient Compilation of Lexical Effect Handlers;Proceedings of the ACM on Programming Languages;2023-10-16