Skip to content

Language card: the syntax in brief and every builtin signature - #149

Merged
rendro merged 2 commits into
w2/repl-type-docfrom
w2/language-card
Oct 24, 2026
Merged

rendro merged 2 commits into
w2/repl-type-docfrom
w2/language-card

Conversation

@rendro

@rendro rendro commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Lane D, PR 2 of 4 (wave 2). Stacked on #147.

  • docs/language-card.md, ~4,200 words. About 1,250 words of prose: a program, lexical rules, literals, bindings and functions, types, match/loop/when, errors, traits, concurrency, tests, operator precedence and tools. Then the generated standard library: the prelude, then every module in registry order with its types, traits and opaque types, and every function or constant on one line, sorted by name. A module or function that needs a cargo feature says which. The card is the same in every build.
  • Generated by render_card in src/builtins/registry/docs.rs. The generator keeps the prose up to a marker line and writes the rest. The sync test stdlib_reference_tests::the_language_card_is_what_the_registry_renders fails on the base; SILT_BLESS=1 rewrites the card.
  • The card's silt programs run under the existing doc-block tests.
  • Linked from the language guide and the README.

Checks: whole suite, clippy both ways, fmt, rustdoc, no-default-features check.

docs/language-card.md is silt on one page (~4,200 words): a program,
the lexical rules, the literals of every kind of value, bindings and
functions, types, match and loop, errors, traits, concurrency, tests,
the operators by precedence and the tools; then the standard library,
every prelude and module function and constant one line each in the
form of the reference pages' signature blocks, with each module's
types, traits and opaque types as declarations, and the cargo feature a
module or a function needs. Its four silt programs run and their
`-- output` comments are what they print (the doc-block tests read
every page).

The standard library part is generated: render_card (beside
render_page in src/builtins/registry/docs.rs) keeps the prose up to the
marker line and writes the rest from the registry, the same in every
build whatever its features. tests/meta/stdlib_reference_tests.rs
compares it with the file; SILT_BLESS=1 rewrites it, as for the
reference pages.

The Language Guide and the README link it. Front matter: section
"Guide", order 6.
The card's prelude and module blocks are now made by module_lines and
prelude_lines, which the REPL's :doc shares since its fix round, so the
two cannot write a declaration differently. The card is unchanged.
@rendro
rendro marked this pull request as ready for review October 24, 2026 12:06
@rendro
rendro merged commit 6ce72a4 into main Oct 24, 2026
23 of 46 checks passed
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.

1 participant