Advisory review: the language guide — from buried markdown to a self-verifying page - #8
Open
mparrett wants to merge 12 commits into
Open
Advisory review: the language guide — from buried markdown to a self-verifying page#8mparrett wants to merge 12 commits into
mparrett wants to merge 12 commits into
Conversation
… DEMO.md Companion page to the engineering tour, same design system. Tutorial is the spine; DEMO.md's stream/cursor material becomes its own section. Sketches and network-only examples are labeled; the sources of truth remain TUTORIAL.md / DEMO.md, which CI executes on every push. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…uide
repl.html gains a hash runner: #code=<URI-encoded source> is fed through
the normal submit path after wasm init (echoed like typed input, history
populated). Two REPL line-at-a-time gotchas are smoothed at intake:
multi-line @{...} match blocks join to the documented single-line idiom,
and multi-line if/then/else chains join so the else doesn't dangle.
The guide marks browser-safe blocks with pre.run; a small script builds
each link from the block's own text (annotation-only lines dropped), so
no snippet is hand-copied. Network examples, sketches, and the comment
demo are unmarked. Verified: all 29 links execute error-free in the wasm
VM via Playwright, with value assertions on 11.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
[profile.wasm-release]: opt-level=z, fat LTO, 1 CGU, panic=abort, strip. panic=abort is safe here: VM errors are Results by design (no catch_unwind in-tree; overflow probed in-browser — clean error, no trap). wasm-opt -Oz needs --enable-bulk-memory since Rust emits bulk-memory ops by default. 2.1MB/580KB-gzip -> 1.13MB/373KB-gzip, verified against the pinned wasm-bindgen 0.2.114 locally. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The globals expose one persistent session VM; the language guide's run-in-place blocks need a fresh VM per run (the doctest harness's semantics) without nuking the session. Exports a constructor plus eval/is_complete with the same output contract as the globals. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-browser
Every runnable block gets ▸ run / edit / reset controls. Run executes
the block in a fresh ReplVm (CI doctest semantics); live results replace
the documented '-- Returns:' lines with ✓/✗ verdicts, and a masthead
'run all blocks' re-verifies the whole page client-side (29/29 locally).
edit swaps the block for a textarea; deep links remain for sharing.
The REPL line-handling logic (multi-line @{} and if/else joining) moves
to a shared docs/fmpl-live.js module used by both repl.html and the
guide, along with the annotation-checking block runner (same conventions
as fmpl-core/tests/doc_examples.rs, including order-insensitive top-level
map compare). wasm loads lazily on first run; prefetch warms the cache.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… ops First CI run of the shrink step failed validation on i32.extend8_s: ubuntu's packaged binaryen predates default sign-ext support. Pin the release that matches the locally verified build. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…quiet exits Assessment findings from a first-visitor walkthrough, addressed: - The hero looked like a REPL but was frozen — now it IS one: ▸ run steps through the demo session statement by statement, and the prompt is a real input (same session VM; reset restarts). The affordance no longer lies. - 'run all blocks' was a verification feature posing as the page's first CTA, and it spent the one-by-one experience. Split: per-block ▸ run now STEPS one statement at a time (≫ finish drains the rest), while §13 gains '✓ verify this page' — non-destructive, fresh VM per block, per-block verdict chips + badge, no text rewritten. reset-all included. - Exit-sign demotion: the caption's 'run in your browser' link is gone (the page runs in the browser); per-block REPL links shrink to a quiet ↗ glyph for sharing. - Caption diet; 'edit' appears only after a block has been run. fmpl-live.js: runBlock refactored into createRunner (statement stepper); runBlock drains it, so verify and stepping share one implementation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Clearing the hint on boot made the first ▸ run visually jarring: the instruction vanished and the transcript shifted up. The hint is already written as an FMPL comment, so it simply stays in the scrollback and the session grows beneath it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…the page The provenance caption moves above the hero — it sets up the terminal rather than captioning it after the fact. §1's opening no longer sends readers to the standalone REPL: the fastest path is this page; the toolchain block covers local installs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tabs The full browser REPL gets one subtle mention in §1 (blank-slate scratch sessions) with a recommendation to keep learning in place. It and the per-block ↗ links now open in a new tab so the guide is never navigated away from. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
'…or type FMPL here' kept reappearing after every submitted line. Once the session is going — stepped or typed — an empty prompt is just an empty prompt; reset restores the invitation. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 25, 2026
Open
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.
The arc
Norman's TUTORIAL.md and DEMO.md were correct (CI executes every fmpl block) but buried — plain markdown at the repo root, unreachable from the Pages site. This phase turns them into a first-class web surface that can prove its own claims:
docs/fmpl-guide.html(96e6711) — web rendering of the tutorial, DEMO's stream/cursor material folded in as its own section, same design system as the tour. Sketches and network-only examples labeled; the markdown files remain the CI-verified sources of truth.repl.html#code=…prefill; every runnable block gets a link. The hash-runner smooths two REPL line-at-a-time gotchas at intake: multi-line@{…}match blocks join to the documented single-line idiom, and multi-lineif/then/elsechains join so theelsedoesn't dangle.[profile.wasm-release](opt-level=z, fat LTO, panic=abort) +wasm-opt -Oz: 2.1 MB / 580 KB-gzip → 1.13 MB / 373 KB-gzip. panic=abort is safe because VM errors areResults by design; probed in-browser (overflow → clean error, no trap).ReplVm(2415a61) — the wasm gains a VM class alongside the global session functions, so a page can hold independent VM instances.▸ run / edit / reset; run executes in a freshReplVm(exactly the doctest harness's per-block semantics), live results replace the documented-- Returns:lines with ✓/✗ verdicts, and a masthead "run all blocks" re-verifies the entire page client-side.editmakes any block a scratchpad. The line-handling and annotation-checking logic lives once, in shareddocs/fmpl-live.js.Verification
just testgreen; clippy clean workspace-wide including the wasm target🤖 Generated with Claude Code