TY - GEN
T1 - Lazy v. Yield
T2 - 10th Asian Symposium on Programming Languages and Systems, APLAS 2012
AU - Kiselyov, Oleg
AU - Peyton-Jones, Simon
AU - Sabry, Amr
PY - 2012
Y1 - 2012
N2 - We propose a programming style for incremental stream processing based on typed simple generators. It promotes modularity and decoupling of producers and consumers just like lazy evaluation. Simple generators, however, expose the implicit suspension and resumption inherent in lazy evaluation as computational effects, and hence are robust in the presence of other effects. Simple generators let us accurately reason about memory consumption. To substantiate our claims we give a new solution to the notorious pretty-printing problem. Like earlier solutions, it is linear, backtracking-free and with bounded latency. It is also simpler to write and reason about, and is compatible with effects including IO, letting us read the source document from a file, and format it as we read.
AB - We propose a programming style for incremental stream processing based on typed simple generators. It promotes modularity and decoupling of producers and consumers just like lazy evaluation. Simple generators, however, expose the implicit suspension and resumption inherent in lazy evaluation as computational effects, and hence are robust in the presence of other effects. Simple generators let us accurately reason about memory consumption. To substantiate our claims we give a new solution to the notorious pretty-printing problem. Like earlier solutions, it is linear, backtracking-free and with bounded latency. It is also simpler to write and reason about, and is compatible with effects including IO, letting us read the source document from a file, and format it as we read.
UR - http://www.scopus.com/inward/record.url?scp=84872232788&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=84872232788&partnerID=8YFLogxK
U2 - 10.1007/978-3-642-35182-2_14
DO - 10.1007/978-3-642-35182-2_14
M3 - Conference contribution
AN - SCOPUS:84872232788
SN - 9783642351815
T3 - Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
SP - 190
EP - 206
BT - Programming Languages and Systems - 10th Asian Symposium, APLAS 2012, Proceedings
Y2 - 11 December 2012 through 13 December 2012
ER -