Complete Fusion for Stateful Streams: Equational Theory of Stateful Streams and Fusion as Normalization-by-Evaluation
Oleg Kiselyov, Tomoaki Kobayashi, Nick Palladinos

TL;DR
This paper introduces a theoretical framework and a high-performance, portable stream processing library that compiles declarative pipelines into efficient imperative code, ensuring correctness through equational reasoning and normalization-by-evaluation.
Contribution
It presents a novel equational theory of stateful streams and a normalization algorithm that enables complete fusion of stream pipelines into optimized state machines.
Findings
Library exceeds performance of existing OCaml stream libraries
Supports finite and infinite streams with rich combinators
Ensures correctness via formal equational theory and normalization
Abstract
Processing large amounts of data fast, in constant and small space is the point of stream processing and the reason for its increasing use. Alas, the most performant, imperative processing code tends to be almost impossible to read, let alone modify, reuse -- or write correctly. We present both a stream compilation theory and its implementation as a portable stream processing library Strymonas that lets us assemble complex stream pipelines just by plugging in simple combinators, and yet attain the performance of hand-written imperative loops and state machines. The library supports finite and infinite streams and offers a rich set of combinators. They may be freely composed, and yet the resulting convoluted imperative code has no traces of combinator abstractions: no closures or intermediate objects. The high-performance is portable and statically guaranteed, without relying on…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsFault Detection and Control Systems · Simulation Techniques and Applications
