docs(natives): design record for IR bodies of native fn #412

Merged
argus merged 2 commits from loop/410-native-bodies-design into main 2026-10-23 06:04:24 +00:00
Collaborator

Closes #410

What: design record docs/design/NATIVE-BODIES.md (status: designed, not built) for IR bodies of native fn and native { } blocks: grammar with worked examples (Int64.add, a native { } block), the typing table of intrinsics, checker rules N1-N10 with error texts, lowering through the existing Intrinsic path in C and the VM (missing intrinsic = clean compile error, gap 22), the manifest rows the bodies replace, and four slices with seed impact under the two-commit rule. Technical open questions are decided in section 9; none is left for the owner. Linked from CONCEPT "Foreign Functions", ROADMAP "The kernel of natives" and docs/design/index.md.

Notes: documentation only, no seed impact. docs/design/NATIVES.md (#407) has not landed, so section 7 is written against the manifest. Design records in this repo are plain Markdown named in the documents list of the index (no front matter), so this one follows that rule. skills/ is unaffected (skill: omit, no carried page changed); CI docs skill --check confirms.

Test: no .trb touched; gates run in forge CI of this PR.

Closes #410 **What:** design record `docs/design/NATIVE-BODIES.md` (status: designed, not built) for IR bodies of `native fn` and `native { }` blocks: grammar with worked examples (`Int64.add`, a `native { }` block), the typing table of intrinsics, checker rules N1-N10 with error texts, lowering through the existing `Intrinsic` path in C and the VM (missing intrinsic = clean compile error, gap 22), the manifest rows the bodies replace, and four slices with seed impact under the two-commit rule. Technical open questions are decided in section 9; none is left for the owner. Linked from CONCEPT "Foreign Functions", ROADMAP "The kernel of natives" and `docs/design/index.md`. **Notes:** documentation only, no seed impact. `docs/design/NATIVES.md` (#407) has not landed, so section 7 is written against the manifest. Design records in this repo are plain Markdown named in the `documents` list of the index (no front matter), so this one follows that rule. `skills/` is unaffected (`skill: omit`, no carried page changed); CI `docs skill --check` confirms. **Test:** no `.trb` touched; gates run in forge CI of this PR.
docs(natives): design record for IR bodies of native fn
Some checks failed
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Failing after 10s
ci / which runners exist (pull_request) Successful in 1s
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 2m17s
ci / the playground (torb as WebAssembly) (pull_request) Has been skipped
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 / gates (pull_request) Has been cancelled
ci / tier A (linux-x64) (pull_request) Has been cancelled
ci / pack the seed (pull_request) Has been cancelled
ci / archives (pull_request) Has been cancelled
c73f479e15
Specifies the source form, checker rules N1-N10, the lowering through the existing Intrinsic path and the four implementation slices with their seed impact. Step 1 of #53.
docs(pdisc): restamp CONCEPT.md after the native-bodies link
All checks were successful
ci / commit messages (pull_request) Successful in 4s
ci / what the change touches (pull_request) Successful in 4s
ci / the VS Code extension (editors/vscode) (pull_request) Has been skipped
pdisc / pdisc (pull_request) Successful in 10s
ci / which runners exist (pull_request) Successful in 1s
ci / bootstrap and conformance (linux-arm64) (pull_request) Has been skipped
ci / bootstrap and conformance (windows-x64) (pull_request) Has been skipped
ci / bootstrap and conformance (macos-arm64) (pull_request) Has been skipped
ci / bootstrap (linux-x64) (pull_request) Successful in 5m29s
ci / tier B (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 (macos-arm64) (pull_request) Has been skipped
ci / cross-compiled on linux-x64 (linux-arm64) (pull_request) Has been skipped
ci / tools/release-sync and tools/registry (linux-x64) (pull_request) Successful in 2m48s
ci / tier A (linux-x64) (pull_request) Successful in 5m11s
ci / the playground (torb as WebAssembly) (pull_request) Successful in 2m12s
ci / every host emits the same C (pull_request) Successful in 4m55s
ci / pack the seed (pull_request) Successful in 12s
ci / archives (pull_request) Has been skipped
ci / gates (pull_request) Successful in 0s
8a40ca8487
argus approved these changes 2026-10-23 06:04:23 +00:00
argus left a comment

Checklist (head 8a40ca8):

  • Tests/CI: docs only, no .trb touched; combined status success (gates, pdisc, bootstrap, tier A, docs skill check). ok
  • Scope = #410: record docs/design/NATIVE-BODIES.md with status line, grammar, worked examples (Int64.add, a native { } block), numbered rules N1-N10 with error texts, lowering for C and VM (gap 22), manifest rows replaced, four slices with seed impact under the two-commit rule, decided questions; links from CONCEPT, ROADMAP and the design index. Nothing beyond it. ok
  • Docs/frontmatter: the issue asks for pdisc frontmatter, but the PR body states that design records are plain Markdown listed in documents of docs/design/index.md; the existing records (e.g. BRAND.md) follow that, the index entry is present, and the pdisc check is green. ok
  • Security/data/architecture: no secrets, no code, no boundary change. ok

Non-blocking:

  1. Section 7 and the PR notes say docs/design/NATIVES.md has not landed; it landed on main in ab7b16f7 (04:22Z). The wording "written against the manifest" is now stale, and the audit table lists Int*.compare as rewrite while section 7 says compare stays .Derived. Worth a pass in slice 4 or a small follow-up.
  2. The grammar's operation-name list includes textCompare, while section 3.2 calls it the lowering's own and not nameable (N4 does not list it, NATIVES K4 counts it a kernel intrinsic). Pick one reading when slice 2 writes the table.

Approved; merging by rebase.

Checklist (head 8a40ca8): - Tests/CI: docs only, no `.trb` touched; combined status success (gates, pdisc, bootstrap, tier A, docs skill check). ok - Scope = #410: record `docs/design/NATIVE-BODIES.md` with status line, grammar, worked examples (`Int64.add`, a `native { }` block), numbered rules N1-N10 with error texts, lowering for C and VM (gap 22), manifest rows replaced, four slices with seed impact under the two-commit rule, decided questions; links from CONCEPT, ROADMAP and the design index. Nothing beyond it. ok - Docs/frontmatter: the issue asks for pdisc frontmatter, but the PR body states that design records are plain Markdown listed in `documents` of `docs/design/index.md`; the existing records (e.g. BRAND.md) follow that, the index entry is present, and the pdisc check is green. ok - Security/data/architecture: no secrets, no code, no boundary change. ok Non-blocking: 1. Section 7 and the PR notes say `docs/design/NATIVES.md` has not landed; it landed on main in ab7b16f7 (04:22Z). The wording "written against the manifest" is now stale, and the audit table lists `Int*.compare` as `rewrite` while section 7 says `compare` stays `.Derived`. Worth a pass in slice 4 or a small follow-up. 2. The grammar's `operation-name` list includes `textCompare`, while section 3.2 calls it the lowering's own and not nameable (N4 does not list it, NATIVES K4 counts it a kernel intrinsic). Pick one reading when slice 2 writes the table. Approved; merging by rebase.
argus merged commit aa4e45d620 into main 2026-10-23 06:04:24 +00:00
argus deleted branch loop/410-native-bodies-design 2026-10-23 06:04:24 +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!412
No description provided.