Paper record
W2295885203Revisiting coroutines
Ana Lúcia de Moura, Roberto Ierusalimschy
- Year
- 2009
- Venue
- ACM Transactions on Programming Languages and Systems
- References
- 37
- Cited by
- 159
Details and counts from OpenAlex.
Abstract
This article advocates the revival of coroutines as a convenient general control abstraction. After proposing a new classification of coroutines, we introduce the concept of full asymmetric coroutines and provide a precise definition for it through an operational semantics. We then demonstrate that full coroutines have an expressive power equivalent to one-shot continuations and one-shot delimited continuations. We also show that full asymmetric coroutines and one-shot delimited continuations have many similarities, and therefore present comparable benefits. Nevertheless, coroutines are easier implemented and understood, especially in the realm of procedural languages.