Journal article icon

Journal article

On the expressive power of user-defined effects: effect handlers, monadic reflection, delimited control

Abstract:

We compare the expressive power of three programming abstractions for user-defined computational effects: Plotkin and Pretnar's effect handlers, Filinski's monadic reflection, and delimited control without answer-type-modification. This comparison allows a precise discussion about the relative expressiveness of each programming abstraction. It also demonstrates the sensitivity of the relative expressiveness of user-defined effects to seemingly orthogonal language features.

We present three calculi, one per abstraction, extending Levy's call-by-push-value. For each calculus, we present syntax, operational semantics, a natural type-and-effect system, and, for effect handlers and monadic reflection, a set-theoretic denotational semantics. We establish their basic metatheoretic properties: safety, termination, and, where applicable, soundness and adequacy. Using Felleisen's notion of a macro translation, we show that these abstractions can macro-express each other, and show which translations preserve typeability. We use the adequate finitary set-theoretic denotational semantics for the monadic calculus to show that effect handlers cannot be macro-expressed while preserving typeability either by monadic reflection or by delimited control. Our argument fails with simple changes to the type system such as polymorphism and inductive types. We supplement our development with a mechanised Abella formalisation.

Publication status:
Accepted
Peer review status:
Peer reviewed

Actions


Access Document


Files:
Publisher copy:
10.1145/3110257

Authors


More by this author
Institution:
University of Oxford
Division:
MPLS
Department:
Computer Science
Role:
Author


More from this funder
Grant:
symmetry—the next-generationsemantics
Eventscausality


Publisher:
Association for Computing Machinery (ACM)
Journal:
Proceedings of the ACM on Programming Languages More from this journal
Volume:
1
Issue:
1
Publication date:
2017-09-01
Acceptance date:
2017-05-01
DOI:
EISSN:
2475-1421

Terms of use



Views and Downloads






If you are the owner of this record, you can report an update to it here: Report update to this record

TO TOP