Syscalls centralized in runtime builtins
Platform spec ADR
Syscalls centralized in runtime builtins
Spec standingStandard
- Contracts and edge cases MUST rules for panic divergence, syscall parameters, and backend neutrality.
- Design model Panic termination, syscall ownership, and runtime-mediated IO boundaries.
- Examples Panic from lowering, syscall_write status codes, and corelib IO scenarios.
- FAQ and troubleshooting Panic vs Option, syscall return codes, and fiber/blocking IO issues.
- Flow and algorithm Panic emission, syscall_write chunking, and blocking IO on fibers.
- Verification and traceability panic_io implementation paths, e2e runtime cases, and IO contract cross-tests.
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).
Context
Section titled “Context”Scattering platform syscall sequences through codegen duplicates policy and breaks GC mutator rules at IO sites.
Decision
Section titled “Decision”| Rule | Detail |
|---|---|
| Builtins | syscall_read, syscall_write accept fd + buffer (BeskidStr for write) |
| Implementation | beskid_runtime::builtins::panic_io — Linux x86_64 direct syscalls in reference tree |
| Other targets | May use std::io for fds 1/2 while preserving signatures |
| Front-end | Must not embed OS-specific syscall sequences in lowering |
| Corelib | System.Input / Output / Error wrap builtins with descriptors |
Git anchor: 12ee673 (split System I/O surfaces).
Consequences
Section titled “Consequences”New platforms document stub vs native behavior without renaming symbols.
Verification anchors
Section titled “Verification anchors”panic_io.rs; console stream corelib tests.