natives: audit and reduce the manifest of natives to a kernel #52

Closed
opened 2026-10-05 21:07:14 +00:00 by orion · 4 comments
Collaborator

Context

Every native of std/ is work for every back end. Reduce compiler/src/backend/c/natives.trb to integer and float arithmetic, comparisons, raw storage and bytes to numbers.

Source

Acceptance criteria

  • A table of every native with its kernel/non-kernel verdict, in a design record
  • Non-kernel natives rewritten in TorbScript where the measured cost allows
  • Gates green in both tiers

Dependencies

None known.

Notes

Adds or changes a native, syntax or a name the compiler looks up: land it in two commits (teach both forms, refresh the seed, then migrate), as CLAUDE.md "Seed and breaking changes" says.

Moved from the planning lists of the docs; the design record stays the specification.

## Context Every native of `std/` is work for every back end. Reduce `compiler/src/backend/c/natives.trb` to integer and float arithmetic, comparisons, raw storage and bytes to numbers. ## Source - [ROADMAP.md, the kernel of natives](https://git.torb.dev/torbscript/language/src/commit/393ef2608e4a60b8ff76d8b6b408951b822d887d/docs/ROADMAP.md#L115) ## Acceptance criteria - [ ] A table of every native with its kernel/non-kernel verdict, in a design record - [ ] Non-kernel natives rewritten in TorbScript where the measured cost allows - [ ] Gates green in both tiers ## Dependencies None known. ## Notes Adds or changes a native, syntax or a name the compiler looks up: land it in two commits (teach both forms, refresh the seed, then migrate), as `CLAUDE.md` "Seed and breaking changes" says. _Moved from the planning lists of the docs; the design record stays the specification._
orion added this to the Kernel of natives milestone 2026-10-05 21:07:14 +00:00
Author
Collaborator

[loop:torbscript] intake: in scope (author orion, label loop), source ROADMAP.md kernel of natives, not a duplicate. Large and seed-relevant (two-commit rule); the audit table is the first slice and a design record, the rewrites follow measured costs (decided with numbers, no owner question); refine splits it. next: refine, waiting (ready buffer full: #4, #163, #164, #223 are ready) until 2026-10-10T04:00:00Z

[loop:torbscript] intake: in scope (author orion, label loop), source ROADMAP.md kernel of natives, not a duplicate. Large and seed-relevant (two-commit rule); the audit table is the first slice and a design record, the rewrites follow measured costs (decided with numbers, no owner question); refine splits it. next: refine, waiting (ready buffer full: #4, #163, #164, #223 are ready) until 2026-10-10T04:00:00Z
Author
Collaborator

[loop:torbscript] claim refine by session:loop-torbscript-20261023 until 2026-10-23T03:49:37Z

[loop:torbscript] claim refine by session:loop-torbscript-20261023 until 2026-10-23T03:49:37Z
Author
Collaborator

[loop:torbscript] decided by the loop: #52 is an epic and is split just in time. Step 1 is #407, the audit table as a design record (docs/design/NATIVES.md), docs and a drift check only, no seed impact. Why first: the verdict per native is a pure reading of the manifest (about 318 native declarations in std/, 19 NativeEntry rows grouped by target kind), and every later rewrite and #53/#55 depend on it. The rewrites follow as further steps once the table exists, each decided by a measurement in forge CI (not asked), each under the two-commit rule where it adds or changes a native; the seed refresh stays Torben's.

[loop:torbscript] decided by the loop: #52 is an epic and is split just in time. Step 1 is #407, the audit table as a design record (`docs/design/NATIVES.md`), docs and a drift check only, no seed impact. Why first: the verdict per native is a pure reading of the manifest (about 318 `native` declarations in `std/`, 19 `NativeEntry` rows grouped by target kind), and every later rewrite and #53/#55 depend on it. The rewrites follow as further steps once the table exists, each decided by a measurement in forge CI (not asked), each under the two-commit rule where it adds or changes a native; the seed refresh stays Torben's.
Author
Collaborator

[loop:torbscript] refine: epic; first step filed as #407 and marked ready (not this issue). Remaining steps (to file when each starts): measure the cost of the rewrite rows, rewrite them in TorbScript in slices, align with #53 and #55. Tokens used by this refine run: about 60k.
next: waiting (epic waits on its steps)

[loop:torbscript] refine: epic; first step filed as #407 and marked `ready` (not this issue). Remaining steps (to file when each starts): measure the cost of the `rewrite` rows, rewrite them in TorbScript in slices, align with #53 and #55. Tokens used by this refine run: about 60k. next: waiting (epic waits on its steps)
argus closed this issue 2026-10-23 04:22:29 +00:00
Sign in to join this conversation.
No labels
loop
ready
No milestone
No project
No assignees
1 participant
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#52
No description provided.