Concurrent System Programming with Effect Handlers

@inproceedings{Dolan2017ConcurrentSP,
  title={Concurrent System Programming with Effect Handlers},
  author={Stephen Dolan and Spiros Eliopoulos and Daniel Hillerstr{\"o}m and Anil Madhavapeddy and K. C. Sivaramakrishnan and Leo White},
  booktitle={TFP},
  year={2017}
}
Algebraic effects and their handlers have been steadily gaining attention as a programming language feature for composably expressing user-defined computational effects. While several prototype implementations of languages incorporating algebraic effects exist, Multicore OCaml incorporates effect handlers as the primary means of expressing concurrency in the language. In this paper, we make the observation that effect handlers can elegantly express particularly difficult programs that combine… 
Structured asynchrony with algebraic effects
TLDR
This article shows how to implement full support for asynchronous programming as a library using just algebraic effect handlers, and introduces the concept of ambient state to reason about state that is local to the current strand of asynchronous execution.
Efficient compilation of algebraic effect handlers
TLDR
This paper shows that the performance gap can be drastically narrowed by means of type-and-effect directed optimising compilation, and that in a number of benchmarks, this approach eliminates much of the overhead of handlers, outperforms capability-passing style compilation and yields competitive performance compared to hand-written OCaml code as well Multicore Ocaml’s dedicated runtime support.
Effect handlers, evidently
TLDR
It is argued one can still express all important effects, while improving reasoning about effect handlers, and it is proved full soundness and coherence of the translation into plain lambda calculus is proved.
First class dynamic effect handlers: or, polymorphic heaps with dynamic effect handlers
TLDR
This article illustrates the expressiveness of dynamic effects with first class event streams in CorrL and also model full polymorphic heap references without requiring any further primitives.
Compiling effect handlers in capability-passing style
TLDR
This paper presents a language for effect handlers in _capability-passing style_ (λCap) and an implementation of this language as a translation to simply-typed lambda calculus in _iterated continuation-passed style_.
Implementing Algebraic Effects in C - "Monads for Free in C"
TLDR
An implementation of algebraic effects and handlers as a library in standard and portable C99, where effect operations can be used just like regular C functions, and a novel extension to the semantics for optimized tail resumptions is shown.
Effect handlers for the masses
TLDR
This work presents the first implementation of effect handlers for Java - an imperative, object oriented programming language with three core components: a type selective CPS transformation via JVM bytecode transformation, an implementation of delimited continuations on top of thebytecode transformation and a library for effect handlers in terms of delimite continuations.
Effects as capabilities: effect handlers and lightweight effect polymorphism
TLDR
The language Effekt is presented with the goal to close the gap between research languages with effect handlers and languages for working programmers and to guarantee effect safety, it separate functions from values and treat all functions as second-class.
Asynchronous effects
TLDR
This paper formalises asynchronous programming with algebraic effects in a small core calculus, called λæ, and demonstrates the flexibility of λâ using examples ranging from a multi-party web application, to preemptive multi-threading, to remote function calls, to a parallel variant of runners ofgebraic effects.
Effekt: Lightweight Effect Polymorphism for Handlers
TLDR
Effekt simplifies the treatment of effect polymorphism and the related issues of effect parametricity and effect encapsulation, and defines the semantics of Effekt as a translation to System Ξ, a calculus in explicit capability-passing style.
...
...

References

SHOWING 1-10 OF 45 REFERENCES
Programming with algebraic effects and handlers
Structured asynchrony with algebraic effects
TLDR
This article shows how to implement full support for asynchronous programming as a library using just algebraic effect handlers, and introduces the concept of ambient state to reason about state that is local to the current strand of asynchronous execution.
Type directed compilation of row-typed algebraic effects
TLDR
This article shows how algebraic effects generalize over common constructs like exception handling, state, iterators and async-await, and gives an effective type inference algorithm based on extensible effect rows using scoped labels, and a direct operational semantics.
Handlers in action
TLDR
This is a position paper whose main aim is to popularise the handler abstraction with a gentle introduction to its use, a collection of illustrative examples, and a straightforward operational semantics.
Liberating effects with rows and handlers
TLDR
This paper argues that the abstraction required to implement extensible effects and their handlers is exactly row polymorphism, and presents a core calculus of row-polymorphic effects and handlers based on a variant of A-normal form used in the intermediate representation of Links.
Efficient algebraic effect handlers for Prolog
TLDR
This work introduces algebraic effect handlers for Prolog, as a high-level and structured way of defining new side-effects in a modular fashion, and illustrates the expressive power of the feature and provides an implementation by means of elaboration into the delimited control primitives.
Programming and reasoning with algebraic effects and dependent types
TLDR
This paper describes an alternative approach based on handling algebraic effects, implemented in the IDRIS programming language, and shows how to describe side effecting computations, how to write programs which compose multiple fine-grained effects, and how to reason about states in effectful programs.
The F# Asynchronous Programming Model
TLDR
The key feature combines a core language with a non-blocking modality to author lightweight asynchronous tasks, where the modality has control flow constructs that are syntactically a superset of the core language and are given an asynchronous semantic interpretation.
Compiling Links Effect Handlers to the OCaml Backend
TLDR
This work presents a compiler for the experimental language Links with effect handlers that interfaces with the Multicore OCaml backend to take advantage of Ocaml’s implementation of efficient handlers.
Composable scheduler activations for Haskell
TLDR
A novel concurrency substrate design for the Glasgow Haskell Compiler is described that allows multicore schedulers for concurrent and parallel Haskell programs to be safely and modularly described as libraries in Haskell.
...
...