docs(hydro): add Quoting Code reference page and expand quoting gotchas into Quoting Limitations - #3093
Open
shadaj wants to merge 1 commit into
Open
docs(hydro): add Quoting Code reference page and expand quoting gotchas into Quoting Limitations#3093shadaj wants to merge 1 commit into
shadaj wants to merge 1 commit into
Conversation
Deploying hydro with
|
| 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 |
…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
force-pushed
the
sandbox-eeb5265c-93fd-44ce-b9fe-b093051d7d86
branch
from
July 30, 2026 21:17
eea2850 to
908daf0
Compare
shadaj
marked this pull request as ready for review
July 31, 2026 00:00
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new user-facing "Quoting Code" page under the Stageleft reference section
(docs/docs/hydro/reference/stageleft/quoting.mdx) explaining:
vs. runtime, with a "what runs when" rule of thumb)
capturable types (integers, &str/String as &'static str), and workarounds for
unsupported types
CLUSTER_SELF_ID and by_ref/by_mut state reference handles
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:
fail at staged-compile time) — Quoted code can only use the public API of
pubtypes (private fields fail at splice time) stageleft#96, related Handlelib_pub.rsgenerate for a pub struct inside a non-pub module stageleft#18/Handlepubstructs inside#[cfg(test)]modules stageleft#43implblocks on private types are not available in quoted code stageleft#97bool(andchar, floats) cannot be captured as free variables in quoted code stageleft#99, Duration Add handling forDurationstageleft#55, general Create a pythonrepr-esque trait for self-serialize/deserializing free variables stageleft#45)moveclosures even for Copy types — Capturing free variables in quoted closures requiresmove, even forCopytypes stageleft#98#[macro_export]) declarative macros is broken stageleft#48-> impl Trait— bug:-> impl Traitreturn types get partially expanded, breaking compilation stageleft#63self::prefix insideq!stageleft#93), module-level imports (Function-localuseimports are not visible insideq!stageleft#94), free variablesin custom-syntax macros (Free variables are not detected inside macros with custom syntax stageleft#95)
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.