Skip to main content

Hydroflow Surface Syntax

The natural way to write a Hydroflow program is using the Surface Syntax documented here. It is a chained Iterator-style syntax of operators built into Hydroflow that should be sufficient for most uses. If you want lower-level access you can work with the Core API documented in the Architecture section.

In this chapter we go over the syntax piece by piece: how to embed surface syntax in Rust and how to specify flows, which consist of data sources flowing through operators.

As a teaser, here is a Rust/Hydroflow "HELLO WORLD" program:

use hydroflow::hydroflow_syntax;

fn main() {
let mut df = hydroflow_syntax! {
source_iter(["Hello", "World"])
-> map(|s| s.to_uppercase())
-> for_each(|s| println!("{}", s));
};

df.run_available();
}