fibers: rename ABI variant .pure -> .naked
"pure" universally means side-effect-free (GCC __attribute__((pure)), FP purity, D's pure) — the opposite of a register-clobbering context switch. The concept is "naked": no compiler-generated prologue/epilogue, body is raw asm that emits its own ret. That is the established term everywhere (LLVM's naked function attribute — which we literally emit — plus Zig callconv(.naked), Rust #[naked], GCC/Clang __attribute__ ((naked))). Rename the keyword + everything keyed off it so concept, surface, field, and the emitted LLVM attribute all agree. - ast.zig: ABI enum variant pure -> naked (+ doc). - parser: accept abi(.naked); error text updated. - IR Function.is_pure -> is_naked; type_resolver/decl/generic/pack/ emit_llvm references updated; diagnostics say abi(.naked). - examples 1800-1803 renamed *-pure-* -> *-naked-* (source + expected/ snapshots; .ir/.exit/.stdout/.stderr are byte-identical — the emitted IR is unchanged, only the keyword spelling differs). - docs (PLAN-FIBERS, CHECKPOINT-FIBERS, PLAN-POST-METATYPE, the design roadmap, the compiler-API checkpoint/design) updated; the naming rationale now records why .naked over .pure. No semantic change — pure cosmetics. Suite green (725/0).
This commit is contained in:
@@ -61,14 +61,14 @@ The colorblind, stackful, pure-sx async runtime (design §4). Compiler floor is
|
||||
the runtime is sx lib. Likely carved as two PLANs:
|
||||
|
||||
### B1 — Fibers + Io + M:1 (the runtime; `PLAN-FIBERS.md`) · 🚧 **CARVED** (not started; first step B1.0a)
|
||||
- B1.0 **`abi(.naked)` — make the EXISTING `.pure` ABI actually naked.** The enum
|
||||
already carries `.pure` (ast.zig:142, documented "pure/naked, no prologue/epilogue"),
|
||||
but it is an **inert label today**: `type_resolver.zig:237` maps `.pure → .default`
|
||||
- B1.0 **`abi(.naked)` — make the EXISTING `.naked` ABI actually naked.** The enum
|
||||
already carries `.naked` (ast.zig:142, documented "naked, no prologue/epilogue"),
|
||||
but it is an **inert label today**: `type_resolver.zig:237` maps `.naked → .default`
|
||||
CC and there is **zero naked-attribute emission in emit_llvm**. So B1.0 is NOT
|
||||
"extend the enum" (done) — it is "emit the LLVM `naked` attr + skip prologue/epilogue
|
||||
lowering for `.pure`," genuinely net-new. (Roadmap §7-step-4's "extend
|
||||
lowering for `.naked`," genuinely net-new. (Roadmap §7-step-4's "extend
|
||||
`CallConv {default, c}`" is stale — CallConv was renamed ABI and already gained
|
||||
`compiler`/`pure` in the compiler-API stream.) Gates the context-switch.
|
||||
`compiler`/`naked` in the compiler-API stream.) Gates the context-switch.
|
||||
- B1.1 **Per-fiber `context` root + `push Context`-stack storage.** Grounding correction:
|
||||
`context` is **already an implicit `*Context` parameter** (comptime_vm.zig:392,
|
||||
lower.zig:257 "Implicit Context parameter machinery"), **not raw TLS** — so it already
|
||||
@@ -192,7 +192,7 @@ module hazard; S2 TLS + C-constructor JIT test per host OS (the exact prior-spik
|
||||
metatype stream), deterministic-`Io` oracle calibration, `context`-fiber-local/errno
|
||||
(C — gated by the named stress harness), S2 (E), C1 args-buffer layout (D).
|
||||
- **The compiler floor stays small, but deep — net-new pieces, grounded:** atomics
|
||||
(100% net-new, no scaffolding), making `abi(.pure)` actually naked (the enum variant
|
||||
(100% net-new, no scaffolding), making `abi(.naked)` actually naked (the enum variant
|
||||
exists but is inert today), per-fiber `context` root + push-stack storage (`context`
|
||||
is already an implicit param, NOT TLS — so this is smaller/different than "repointable
|
||||
codegen" implied), `declare`/`define`/`type_info` (metatype stream — **done**), the
|
||||
|
||||
Reference in New Issue
Block a user