Latent Effects for Reusable Language Components: Extended Version
Birthe van den Berg, Tom Schrijvers, Casper Bach-Poulsen, Nicolas Wu

TL;DR
This paper introduces latent effects, a modular framework for modeling advanced control-flow mechanisms like lazy evaluation and staging, extending algebraic effects and datatypes a la carte.
Contribution
It defines latent effects as a new modular approach to represent complex control-flow features in programming languages.
Findings
Latent effects can express call-by-name, call-by-need, and staging.
The approach is demonstrated with a full Haskell implementation.
Complex semantics can be built by combining latent effects.
Abstract
The development of programming languages can be quite complicated and costly. Hence, much effort has been devoted to the modular definition of language features that can be reused in various combinations to define new languages and experiment with their semantics. A notable outcome of these efforts is the algebra-based "datatypes a la carte" (DTC) approach. When combined with algebraic effects, DTC can model a wide range of common language features. Unfortunately, the current state of the art does not cover modular definitions of advanced control-flow mechanisms that defer execution to an appropriate point, such as call-by-name and call-by-need evaluation, as well as (multi-)staging. This paper defines latent effects, a generic class of such control-flow mechanisms. We demonstrate how function abstractions, lazy computations and a MetaML-like staging can all be expressed in a modular…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Parallel Computing and Optimization Techniques · Distributed systems and fault tolerance
