Skip to content

feat(hydro_lang): preliminary support for embedding Hydro programs in other Rust code#2557

Open
shadaj wants to merge 1 commit intomainfrom
pr2557
Open

feat(hydro_lang): preliminary support for embedding Hydro programs in other Rust code#2557
shadaj wants to merge 1 commit intomainfrom
pr2557

Conversation

@shadaj
Copy link
Member

@shadaj shadaj commented Feb 6, 2026

When we got rid of the original macro-entrypoint approach to building Hydro programs (in favor of trybuild + Hydro Deploy), we also lost option to incrementally adopt Hydro in existing Rust codebases by manually instantiating the DFIR projections for each location.

This is the first step towards restoring this incremental adoption path by using build scripts as a mechanism to pull generated DFIR projections into a regular Rust crate. For now, we do not support any external inputs or outputs or inter-location networking. In followup PRs, we will start with external in/out support and later support networking operators (which require more design work).

Stack created with Sapling. Best reviewed with ReviewStack.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 6, 2026

Deploying hydro with  Cloudflare Pages  Cloudflare Pages

Latest commit: e21bca2
Status: ✅  Deploy successful!
Preview URL: https://1f258e9c.hydroflow.pages.dev
Branch Preview URL: https://pr2557.hydroflow.pages.dev

View logs

"rust-analyzer.rustfmt.extraArgs": [
"+nightly"
],
"rust-analyzer.cargo.features": "all",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to avoid build.rs thrashing...

@shadaj shadaj marked this pull request as ready for review February 6, 2026 23:24
@shadaj shadaj force-pushed the pr2557 branch 5 times, most recently from 2a8db50 to 7117bc9 Compare February 6, 2026 23:48
@shadaj
Copy link
Member Author

shadaj commented Feb 6, 2026

Fixes #1871

… other Rust code

When we got rid of the original macro-entrypoint approach to building Hydro programs (in favor of trybuild + Hydro Deploy), we also lost option to incrementally adopt Hydro in existing Rust codebases by manually instantiating the DFIR projections for each location.

This is the first step towards restoring this incremental adoption path by using build scripts as a mechanism to pull generated DFIR projections into a regular Rust crate. For now, we do not support any external inputs or outputs or inter-location networking. In followup PRs, we will start with external in/out support and later support networking operators (which require more design work).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate Rust crates with a stable entrypoint to integrate Hydro code into existing Rust codebases

1 participant