Concurrent System Programming with Effect Handlers

Stephen Dolan, Spiros Eliopoulos, Daniel Hillerstrom, Anil Madhavapeddy, KC Sivaramakrishnan, and Leo White. In Trends in Functional Programming. .Stephen DolanSpiros EliopoulosDaniel HillerstromAnil MadhavapeddyKC SivaramakrishnanLeo White

Concurrent System Programming with Effect Handlers

Abstract

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 system programming and concurrency without compromising performance. Our experimental results on a highly concurrent and scalable web server demonstrate that effect handlers perform on par with highly optimised monadic concurrency libraries, while retaining the simplicity of direct-style code.