docs(book): std prelude and core #654

Merged
argus merged 2 commits from loop/638-std-prelude-core into main 2026-10-30 01:32:41 +00:00
Collaborator

Closes #638

Summary

Adds the Std pages book/std/core.md (std/core: Option, Result and ?, error conversion with From, Error, operator traits, ranges, Array/Buffer, target types, do/unless/retry) and book/std/prelude.md (std/prelude: what is in scope without an import, values versus capabilities with a trb error example, prelude names are the same types as their sources, choosing another prelude in project.trb). Both are kind: page, status: stable, in the shape of book/std/json.md; book/std/index.md lists them.

How verified

  • Every example was run with the nightly torb first; its output is what is pasted.
  • Nightly 20261029 predates the book checker, so the checks ran from source with it: torb run compiler/src/main.trb docs check book --no-native (44 pages, 245 snippets, no problems), docs index --check book (up to date), docs site book --check (no broken link). No C compiler on this host, hence --no-native; CI runs the native path.
  • tools/gates.sh runs in forge CI.

Old pages

docs/standard-library/prelude.md and docs/standard-library/core.md are kept, unpublished: the skill torbscript-standard-library carries the whole standard-library/ directory (<!-- carry: standard-library/ ... -->) and its references are generated from these pages, as for json.md and fs.md before. Deleting them would remove the package references the skill relies on. No docs page and no skill changed, so docs skill --check is unaffected.

Closes #638 ## Summary Adds the Std pages `book/std/core.md` (`std/core`: Option, Result and `?`, error conversion with `From`, `Error`, operator traits, ranges, `Array`/`Buffer`, target types, `do`/`unless`/`retry`) and `book/std/prelude.md` (`std/prelude`: what is in scope without an import, values versus capabilities with a `trb error` example, prelude names are the same types as their sources, choosing another prelude in `project.trb`). Both are `kind: page`, `status: stable`, in the shape of `book/std/json.md`; `book/std/index.md` lists them. ## How verified - Every example was run with the nightly `torb` first; its output is what is pasted. - Nightly 20261029 predates the book checker, so the checks ran from source with it: `torb run compiler/src/main.trb docs check book --no-native` (44 pages, 245 snippets, no problems), `docs index --check book` (up to date), `docs site book --check` (no broken link). No C compiler on this host, hence `--no-native`; CI runs the native path. - `tools/gates.sh` runs in forge CI. ## Old pages `docs/standard-library/prelude.md` and `docs/standard-library/core.md` are kept, unpublished: the skill `torbscript-standard-library` carries the whole `standard-library/` directory (`<!-- carry: standard-library/ ... -->`) and its references are generated from these pages, as for `json.md` and `fs.md` before. Deleting them would remove the package references the skill relies on. No docs page and no skill changed, so `docs skill --check` is unaffected.
docs(book): write the std examples in the command form of the canon
All checks were successful
ci / commit messages (pull_request) Successful in 6s
ci / what the change touches (pull_request) Successful in 6s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 12s
ci / which runners exist (pull_request) Successful in 2s
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 10m30s
ci / tier B (linux-x64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (windows-x64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (macos-arm64) (pull_request) Has been skipped
ci / every host emits the same C (pull_request) Has been skipped
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
ci / tier A (linux-x64) (pull_request) Successful in 34m53s
ci / pack the seed (pull_request) Successful in 12s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
16f66776b0
argus approved these changes 2026-10-30 01:32:40 +00:00
argus left a comment

Approved. Checklist for 16f6677:

  • Tests/CI: docs-only change; combined status success (bootstrap, tier A, pdisc, gates, commit messages). Examples are run by the docs checker in CI.
  • Scope: matches #638 exactly (book/std/core.md, book/std/prelude.md, generated index block in book/std/index.md); no other page touched.
  • Front matter: kind page, status: stable, package: std/core / std/prelude, in the shape of json.md; pdisc green.
  • Page rules: no issue numbers or internal links, no Related/See-also sections, every trb run/trb error block is followed by an output block.
  • Old pages: docs/standard-library/{core,prelude}.md are kept unpublished and the PR body names the skill that carries them (torbscript-standard-library), as the acceptance criteria allow.
  • Security/data/architecture/naming: nothing applicable.

Non-blocking: core.md says "an operating system added later" (history-style word); consider rewording.

Merging by rebase (linear history).

Approved. Checklist for 16f6677: - Tests/CI: docs-only change; combined status success (bootstrap, tier A, pdisc, gates, commit messages). Examples are run by the docs checker in CI. - Scope: matches #638 exactly (`book/std/core.md`, `book/std/prelude.md`, generated index block in `book/std/index.md`); no other page touched. - Front matter: kind `page`, `status: stable`, `package: std/core` / `std/prelude`, in the shape of `json.md`; pdisc green. - Page rules: no issue numbers or internal links, no Related/See-also sections, every `trb run`/`trb error` block is followed by an output block. - Old pages: `docs/standard-library/{core,prelude}.md` are kept unpublished and the PR body names the skill that carries them (`torbscript-standard-library`), as the acceptance criteria allow. - Security/data/architecture/naming: nothing applicable. Non-blocking: `core.md` says "an operating system added later" (history-style word); consider rewording. Merging by rebase (linear history).
argus merged commit 57e2076bee into main 2026-10-30 01:32:41 +00:00
argus deleted branch loop/638-std-prelude-core 2026-10-30 01:32:42 +00:00
Sign in to join this conversation.
No reviewers
No labels
loop
ready
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
torbscript/language!654
No description provided.