Skip to content

docs(hydro): add Quoting Code reference page and expand quoting gotchas into Quoting Limitations - #3093

Open
shadaj wants to merge 1 commit into
mainfrom
sandbox-eeb5265c-93fd-44ce-b9fe-b093051d7d86
Open

docs(hydro): add Quoting Code reference page and expand quoting gotchas into Quoting Limitations#3093
shadaj wants to merge 1 commit into
mainfrom
sandbox-eeb5265c-93fd-44ce-b9fe-b093051d7d86

Conversation

@shadaj

@shadaj shadaj commented Jul 30, 2026

Copy link
Copy Markdown
Member

Adds a new user-facing "Quoting Code" page under the Stageleft reference section
(docs/docs/hydro/reference/stageleft/quoting.mdx) explaining:

  • the two-stage execution model and what the q! macro does (graph construction
    vs. runtime, with a "what runs when" rule of thumb)
  • capturing variables (free variables): snapshot semantics, the supported set of
    capturable types (integers, &str/String as &'static str), and workarounds for
    unsupported types
  • Hydro's special free variables that resolve to live values at runtime:
    CLUSTER_SELF_ID and by_ref/by_mut state reference handles
  • referencing module-level functions/types from quoted code

Rewrites the errors page as "Quoting Limitations", keeping the original three
gotchas and adding newly verified ones, each linked to a tracking issue on
hydro-project/stageleft:

Issues 93–99 were filed as part of this change; the behaviors were verified
empirically against a scratch copy of the stageleft test crates (private-field
access, private-type methods, derive behavior, capture errors, move requirement,
and generic-parameter splicing).

Also updates the Stageleft index page to link both pages and fixes the
quickstart link text. All compiled doc examples pass cargo test -p hydro_test --doc (mdtests), and the MDX was validated with @mdx-js/mdx.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 30, 2026

Copy link
Copy Markdown

Deploying hydro with  Cloudflare Pages  Cloudflare Pages

Latest commit: 908daf0
Status: ✅  Deploy successful!
Preview URL: https://f195b8d8.hydroflow.pages.dev
Branch Preview URL: https://sandbox-eeb5265c-93fd-44ce-b.hydroflow.pages.dev

View logs

…ll tracked edge cases

Adds a new "Quoting Code" reference page (quoting.mdx) explaining the q! macro,
the two-stage execution model, variable capture (free variables) with snapshot
semantics and supported types, and Hydro's special free variables
(CLUSTER_SELF_ID, by_ref/by_mut state references). All runnable examples are
verified doctests.

Rewrites the errors page as "Quoting Limitations", covering every known
user-facing edge case with a workaround and a tracking issue on
hydro-project/stageleft:
- self:: for local functions (#93), module-level imports (#94), free variables
  in custom-syntax macros (#95) — issues newly filed
- pub types usable only through their public API (#96, related #18/#43) and
  handwritten impls on private types unavailable (#97) — newly filed, verified
  empirically
- unsupported capture types (bool #99 newly filed, Duration #55, general #45)
- captures require `move` (#98, newly filed), generic type parameters (#47),
  private declarative macros (#48), `-> impl Trait` helpers (#63), multiple
  top-level statements (#20), spurious unused_braces warnings (#91)
- NEW: "Types Defined in Private Modules" section explaining the rewrite-rule
  system for private definition paths and the `stageleft::add_private_reexport`
  ctor escape hatch used by hydro_lang (#72; verified that the std::iter::repeat
  case is fixed in stageleft 0.15.1 and commented on the issue)
- NEW: `#[cfg(stageleft_runtime)]` cannot be combined inside `all(...)` (#6)
- NEW: self-dependencies in [dev-dependencies] (#39)

Also links both pages from the Stageleft index and updates the quickstart link
text. Doctests pass via `cargo test -p hydro_test --doc`; MDX validated with
@mdx-js/mdx.

Co-authored-by: Infinity 🤖 <infinity@hydro.run>
PR: #3093
@shadaj
shadaj force-pushed the sandbox-eeb5265c-93fd-44ce-b9fe-b093051d7d86 branch from eea2850 to 908daf0 Compare July 30, 2026 21:17
@shadaj
shadaj marked this pull request as ready for review July 31, 2026 00:00
@shadaj
shadaj requested a review from a team July 31, 2026 00:00
@MingweiSamuel
MingweiSamuel requested a lite review from Copilot August 5, 2026 21:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the Hydro Stageleft documentation by adding a new “Quoting Code” reference page and reworking the existing quoting errors page into a more comprehensive “Quoting Limitations” page, with links to Stageleft tracking issues for each limitation.

Changes:

  • Added a new Stageleft reference page documenting the q! two-stage execution model, free-variable capture semantics, and special runtime-resolved handles.
  • Rewrote the existing quoting errors page into “Quoting Limitations” with additional verified edge cases and links to Stageleft issues.
  • Updated Stageleft index and Quickstart copy to link to and reference the new/renamed documentation.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
docs/docs/hydro/reference/stageleft/quoting.mdx New “Quoting Code” page explaining q!, capture semantics, and special free variables.
docs/docs/hydro/reference/stageleft/index.mdx Adds links to the new Quoting Code page and the Quoting Limitations page; refines note text.
docs/docs/hydro/reference/stageleft/errors.mdx Retitles/restructures into “Quoting Limitations” and expands the catalog of documented gotchas with issue links.
docs/docs/hydro/learn/quickstart/index.mdx Updates link text to refer to “Quoting Limitations” (same target file).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants