Streams a la carte: Extensible Pipelines with Object Algebras

Aggelos Biboudis, Nick Palladinos, George Fourtounis, Yannis Smaragdakis, Marc Herbstritt
2015 European Conference on Object-Oriented Programming  
Streaming libraries have become ubiquitous in object-oriented languages, with recent offerings in Java, C#, and Scala. All such libraries, however, suffer in terms of extensibility: there is no way to change the semantics of a streaming pipeline (e.g., to fuse filter operators, to perform computations lazily, to log operations) without changes to the library code. Furthermore, in some languages it is not even possible to add new operators (e.g., a zip operator, in addition to the standard map,
more » ... ilter, etc.) without changing the library. We address such extensibility shortcomings with a new design for streaming libraries. The architecture underlying this design borrows heavily from Oliveira and Cook's object algebra solution to the expression problem, extended with a design that exposes the push/pull character of the iteration, and an encoding of higher-kinded polymorphism. We apply our design to Java and show that the addition of full extensibility is accompanied by high performance, matching or exceeding that of the original, highly-optimized Java streams library.
doi:10.4230/lipics.ecoop.2015.591 dblp:conf/ecoop/BiboudisPFS15 fatcat:qotqjws5yvcbhkyfhadyhncqmy