Asynchronous effects

03/04/2020
by   Danel Ahman, et al.
0

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, called λ_ae. We demonstrate the flexibility of λ_ae using examples ranging from a multi-party web application, to preemptive multi-threading, to remote function calls, to a parallel variant of runners of algebraic effects. In addition, the paper is accompanied by a formalisation of λ_ae's type safety proofs in Agda, and a prototype implementation of λ_ae in OCaml.

READ FULL TEXT

Please sign up or login with your details

Forgot password? Click here to reset