Expressive power of one-shot control operators and coroutines
Kentaro Kobayashi, Yukiyoshi Kameyama
Abstract
Control operators, such as exceptions and effect handlers, provide a means of representing computational effects in programs abstractly and modularly. While most theoretical studies have focused on multi-shot control operators, one-shot control operators---which restrict the use of captured continuations to at most once---are gaining attention for their balance between expressiveness and efficiency. This study aims to fill the gap. We present a mathematically rigorous comparison of the expressive power among one-shot control operators, including effect handlers, delimited continuations, and even asymmetric coroutines. Following previous studies on multi-shot control operators, we adopt Felleisen's macro-expressiveness as our measure of expressiveness. We verify the folklore that one-shot effect handlers and one-shot delimited-control operators can be macro-expressed by asymmetric coroutines, but not vice versa. We explain why a previous informal argument fails, and how to revise it to make a valid macro-translation.
Create a lesson
Related papers
On the Expressive Power of Hook-Indexed State: Comprehending State in the React UI Library (Extended Version)
Shared title terminology · Toby Ueno, Ezra Cooper, Simon Fowler et al.
An Algebraic Perspective on Operational Semantics
Shared title terminology · Eric Bond, Max New
CFGKAT: A Complete Calculus for Non-Local Control Flow
Shared title terminology · Spencer Van Koevering, Alexandra Silva, Cheng Zhang et al.
GUARDTs: Decentralized Access Control for Replicated Data Types
Shared title terminology · Christian Kuessner, Ragnar Mogk, Julian Haas et al.
On the Expressiveness of Asynchronous Processes with Nested Session Types (Extended Version)
Shared title terminology · Sjors Wortelboer, Dan Frumin, Jorge A. Pérez
Polarized Scheme: duality of computation, delimited control, and continuation-passing macro Interleaving
Shared title terminology · Christopher Dutchyn