|
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.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
|
| |
2
|
|
| |
3
|
|
 |
4
|
Carl Bruggeman , Oscar Waddell , R. Kent Dybvig, Representing control in the presence of one-shot continuations, Proceedings of the ACM SIGPLAN 1996 conference on Programming language design and implementation, p.99-107, May 21-24, 1996, Philadelphia, Pennsylvania, United States
|
| |
5
|
|
| |
6
|
Conway, D. 2000. Rfc 31: Subroutines: Co-routines. http://dev.perl.org/perl6/rfc/31.html.
|
 |
7
|
|
| |
8
|
|
 |
9
|
|
| |
10
|
|
| |
11
|
Felleisen, M. 1985. Transliterating Prolog into Scheme. Tech. rep. 182, Indiana University.
|
 |
12
|
|
| |
13
|
|
| |
14
|
Felleisen, M. and Friedman, D. 1986. Control operators, the SECD-machine, and the λ-calculus. In Formal Description of Programming Concepts-III, M. Wirsing, Ed. North-Holland, 193--217.
|
| |
15
|
|
 |
16
|
Bruce Duba , Robert Harper , David MacQueen, Typing first-class continuations in ML, Proceedings of the 18th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.163-173, January 21-23, 1991, Orlando, Florida, United States
[doi> 10.1145/99583.99608]
|
| |
17
|
|
| |
18
|
|
| |
19
|
|
 |
20
|
|
 |
21
|
|
| |
22
|
|
| |
23
|
|
| |
24
|
Ierusalimschy, R. and de Moura, A. L. 2008. Some proofs about coroutines. Monografias em Ciẽncia da Computação 04/08, PUC-Rio, Rio de Janeiro, Brazil.
|
| |
25
|
|
 |
26
|
|
| |
27
|
H. Abelson , R. K. Dybvig , C. T. Haynes , G. J. Rozas , N. I. Adams Iv , D. P. Friedman , E. Kohlbecker , G. L. Steele, Jr. , D. H. Bartley , R. Halstead , D. Oxley , G. J. Sussman , G. Brooks , C. Hanson , K. M. Pitman , M. Wand, Revised Report on the Algorithmic Language Scheme, Higher-Order and Symbolic Computation, v.11 n.1, p.7-105, August 1998
[doi> 10.1023/A:1010051815785]
|
| |
28
|
Knuth, D. E. 1968. The Art of Computer Programming, Volume 1, Fundamental Algorithms. Addison-Wesley, Reading, MA.
|
| |
29
|
|
 |
30
|
|
| |
31
|
|
| |
32
|
Moody, K. and Richards, M. 1980. A coroutine mechanism for BCPL. Softw. Pract. & Exper. 10, 10, 765--771.
|
| |
33
|
Moura, A., Rodriguez, N., and Ierusalimschy, R. 2004. Coroutines in Lua. J. Universal Comput. Sci. 10, 7, 910--925.
|
 |
34
|
|
| |
35
|
Pauli, W. and Soffa, M. L. 1980. Coroutine behaviour and implementation. Softw, Pract. & Exper. 10, 3, 189--204.
|
 |
36
|
|
| |
37
|
|
| |
38
|
Schemenauer, N., Peters, T., and Hetland, M. 2001. PEP 255: Simple generators. http://www.python.org/peps/pep-0255.html.
|
 |
39
|
|
 |
40
|
|
| |
41
|
|
| |
42
|
|
| |
43
|
Tismer, C. 2000. Continuations and stackless Python. In Proceedings of the 8th International Python Conference. Arlington, VA. http://www.python.org/workshops/2000-01/proceedings.html.
|
| |
44
|
|
 |
45
|
|
| |
46
|
|
|