Download PDF

PADL 2019 - 21st International Symposium on Practical Aspects of Declarative Languages, Date: 2019/01/14 - 2019/01/15, Location: Cascais/Lisbon, Portugal

Publication date: 2019-01-01
Volume: 11372 Pages: 133 - 149
ISSN: 978-3-030-05997-2
Publisher: Springer Verlag

Lecture Notes in Computer Science

Author:

Pieters, Ruben
Schrijvers, Tom

Keywords:

Science & Technology, Technology, Computer Science, Software Engineering, Computer Science, Theory & Methods, Computer Science, Stream processing, Structured recursion, Algebra

Abstract:

Spivey has recently presented a novel functional representation that supports the efficient composition, or merging, of coroutine pipelines for processing streams of data. This representation was inspired by Shivers and Might's three-continuation approach and is shown to be equivalent to a simple yet inefficient executable specification. Unfortunately, neither Shivers and Might's original work nor the equivalence proof sheds much light on the underlying principles allowing the derivation of this efficient representation from its specification. This paper gives the missing insight by reconstructing a systematic derivation in terms of known transformation steps from the simple specification to the efficient representation. This derivation sheds light on the limitations of the representation and on its applicability to other settings. In particular, it has enabled us to obtain a similar representation for pipes featuring two-way communication, similar to the Haskell pipes library. Our benchmarks confirm that this two-way representation retains the same improved performance characteristics.