Published June 2024 | Version Published
Journal Article Open

Stream Types

Abstract

We propose a rich foundational theory of typed data streams and stream transformers, motivated by two high-level goals. First, the type of a stream should be able to express complex sequential patterns of events over time. And second, it should describe the internal parallel structure of the stream, to support deterministic stream processing on parallel and distributed systems. To these ends, we introduce stream types, with operators capturing sequential composition, parallel composition, and iteration, plus a core calculus λST of transformers over typed streams that naturally supports a number of common streaming idioms, including punctuation, windowing, and parallel partitioning, as first-class constructions. λST exploits a Curry-Howard-like correspondence with an ordered variant of the Logic of Bunched Implication to program with streams compositionally and uses Brzozowski-style derivatives to enable an incremental, prefix-based operational semantics. To illustrate the programming style supported by the rich types of λST, we present a number of examples written in Delta, a prototype high-level language design based on λST.

Copyright and License

© 2024 Copyright held by the owner/author(s). This work is licensed under a Creative Commons Attribution 4.0 International License.

Acknowledgement

We thank the anonymous reviewers for their feedback. We also thank Justin Lubin for feedback on drafts of this paper, Will Sturgeon for help with formalizing the most intricate details of the theory of stream types, and PLClub, Alex Kavvos, Andrew Hirsch, Mae Milano, and Michael Arntzenius for helpful discussions about this work. Cutler was supported by a NSF Graduate Research Fellowship under grant number 2022334433, Waston by NSF awards 1763514 and 2331783, Hilliard by NSF Award III-1910108, and Pierce and Goldstein by NSF Award 1421243, Random Testing for Language Design.

Files

3656434.pdf

Files (323.8 kB)

Name Size
md5:739dc5f4ad1075881e047fd6307619f7
323.8 kB Preview Download

Additional details

Funding

National Science Foundation
NSF Graduate Research Fellowship 2022334433
National Science Foundation
CCF-1763514
National Science Foundation
IIS-2331783
National Science Foundation
IIS-1910108
National Science Foundation
CCF-1421243