Monolithic IO.bd hid syscall direction and descriptor typing.
Flow and algorithm
Platform spec article
Flow and algorithm
Spec standingStandard
-
stdin/stdout/stderr are separate runtime-backed modules.
Context
Decision
Rule Detail Surface System.Input,System.Output,System.Errorunderpackages/runtimeNon-goal Monolithic IO.bdfor standard streamsConsequences
Syscall descriptors stay typed per stream.
Verification anchors
packages/runtime/src/System/; stream contract tests. -
ANSI and terminal helpers live in corelib_console.
Context
Higher console work must not bloat runtime syscall modules.
Decision
Rule Detail Package compiler/corelib/packages/console(corelib_console)Runtime Streams stay in runtime package Consequences
Terminal features document against console package anchors.
Verification anchors
packages/console; pckg workspace publish. -
Runtime-backed surfaces require coordinated ABI bumps.
Context
Builtin shape changes break AOT/JIT link without version alignment.
Decision
Rule Detail Version beskid_runtime_abi_version/BESKID_RUNTIME_ABI_VERSIONmust matchChange Requires beskid_abi, runtime, and corelib updates togetherConsequences
Link failures surface at build time, not lazy dlopen.
Verification anchors
beskid_abi/src/builtins.rs;abi/contracts.rs. -
Foundation-style modules without builtins follow normal lowering.
Context
Not every corelib module is runtime-backed.
Decision
Rule Detail In scope Builtin/syscall facades documented here Out of scope Pure Beskid foundationmodulesConsequences
This feature does not duplicate language-meta semantics for pure libraries.
Verification anchors
foundation package compile tests.
- Contracts and edge cases Stability guarantees for runtime-backed corelib APIs.
- Design model Corelib APIs implemented by runtime builtins and ABI-stable syscall surfaces.
- Examples Examples of runtime-backed corelib surfaces.
- FAQ and troubleshooting FAQ for runtime-backed corelib surfaces.
- Flow and algorithm Call path from Beskid corelib methods to runtime builtins.
- Verification and traceability Verification for runtime-backed corelib surfaces.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Call lowering flow
Section titled “Call lowering flow”sequenceDiagram participant Src as Beskid method participant CG as codegen participant RT as beskid_runtime participant OS as host OS Src->>CG: resolve builtin id CG->>RT: extern C-unwind call RT->>OS: syscall_read/write (I/O) RT-->>Src: managed return / GC handles
- Semantic resolution binds call to a known runtime builtin or inlined fast path.
- Codegen emits ABI-stable symbol reference from
beskid_abitables. - JIT (
beskid_engine) or AOT (beskid_aot) links runtime object providing the symbol. - Builtin implementation enforces GC safepoints, panic translation, and I/O error mapping.
I/O split algorithm
Section titled “I/O split algorithm”System.Input— read paths funnel throughsyscall_readhelpers inpanic_iomodule.System.Output/System.Error— write paths usesyscall_writewith distinct handles where the host distinguishes stderr.- Console package — layers formatting/ANSI on top without redefining syscall contracts.
Fiber and GC interaction
Section titled “Fiber and GC interaction”Fiber builtins (fiber_spawn, fiber_yield, …) and GC builtins (gc_collect, write barriers) share the same registration hub (hub module). Corelib wrappers must not reimplement scheduler logic in Beskid-only code paths for normative behavior.
Verification flow
Section titled “Verification flow”ABI contract tests compare declared signatures against runtime exports before release tags ship.
compiler/crates/beskid_tests/src/abi/contracts.rs is the primary gate; extend when adding builtin surfaces.