Higher-Order Asynchronous Effects
Danel Ahman, Matija Pretnar

TL;DR
This paper introduces a novel approach to asynchronous programming with algebraic effects, enabling flexible handling of asynchrony through decoupled operation execution and interruption, supported by formal proofs and a prototype implementation.
Contribution
It extends algebraic effects to naturally incorporate asynchrony, formalising the approach with a calculus, type safety proofs, and an OCaml prototype.
Findings
Demonstrates flexibility with examples like web apps and multi-threading
Provides formal type safety proofs in Agda
Includes a working OCaml prototype implementation
Abstract
We explore asynchronous programming with algebraic effects. We complement their conventional synchronous treatment by showing how to naturally also accommodate asynchrony within them, namely, by decoupling the execution of operation calls into signalling that an operation's implementation needs to be executed, and interrupting a running computation with the operation's result, to which the computation can react by installing interrupt handlers. We formalise these ideas in a small core calculus and demonstrate its flexibility using examples ranging from a multi-party web application, to pre-emptive multi-threading, to (cancellable) remote function calls, to a parallel variant of runners of algebraic effects. In addition, the paper is accompanied by a formalisation of the calculus's type safety proofs in Agda, and a prototype implementation in OCaml.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Distributed systems and fault tolerance · Logic, programming, and type systems
