Effects for efficiency: asymptotic speedup with first-class control

  title={Effects for efficiency: asymptotic speedup with first-class control},
  author={Daniel Hillerstr{\"o}m and Sam Lindley and John R. Longley},
  journal={Proceedings of the ACM on Programming Languages},
  pages={1 - 29}
We study the fundamental efficiency of delimited control. Specifically, we show that effect handlers enable an asymptotic improvement in runtime complexity for a certain class of functions. We consider the generic count problem using a pure PCF-like base language λb and its extension with effect handlers λh. We show that λh admits an asymptotically more efficient implementation of generic count than any λb implementation. We also show that this efficiency gap remains when λb is extended with… 
1 Citations

Figures and Tables from this paper

Scalable Handling of Effects
Five key problem areas to be addressed at this Dagstuhl Seminar are identified in order to enable effect handlers to scale: Safety, Modularity, Interoperability, Legibility, and Efficiency.


Handlers in action
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.
Abstracting algebraic effects
This paper introduces and examines programming language constructs that back adoption of programming with algebraic effects on a larger scale in a modular fashion by providing mechanisms for abstraction and presents an experimental programming language based on this calculus, which provides strong abstraction mechanisms via an ML-style module system.
Typed Equivalence of Effect Handlers and Delimited Control
This work positively resolve the conjecture that in an appropriately polymorphic type system this relationship between effect handlers and delimited control operators can be extended to the level of types, by identifying the necessary forms of polymorphism, thus extending the definability result to the typed context.
On the expressive power of user-defined effects: effect handlers, monadic reflection, delimited control
It is shown that effect handlers cannot be macro-expressed while preserving typeability either by monadic reflection or by delimited control, and the adequate finitary set-theoretic denotational semantics for the monadic calculus is used.
Extensible effects: an alternative to monad transformers
A library that solves the long-standing problem of combining effects without imposing restrictions on their interactions (such as static ordering), allowing for practical idioms that are inefficient, cumbersome, or outright impossible with monad transformers.
Adequacy for Algebraic Effects
This work considers call-by-value PCF with-- and without--recursion, an extension of λc with arithmetic, and proves general adequacy theorems, and illustrates these with two examples: nond determinism and probabilistic nondeterminism.
Shallow Effect Handlers
It is shown that deep and shallow handlers can simulate one another up to specific notions of administrative reduction, and the first formal accounts of an abstract machine for shallow handlers are presented.
Liberating effects with rows and handlers
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.
Type directed compilation of row-typed algebraic effects
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.
Effect handlers via generalised continuations
This paper gives two distinct foundational implementations of a continuation-passing style (CPS) transformation and a CEK-style abstract machine for implementing effect handlers, and has implemented both the abstract machine and the CPS transformation (plus extensions) as backends for the Links web programming language.