Runtime builtins use C-unwind exports
Platform spec ADR
Runtime builtins use C-unwind exports
Spec standingStandard
- Contracts and edge cases MUST rules for builtin signatures, return kinds, and export name stability.
- Design model BuiltinFnSpec catalog, runtime export symbols, and codegen import boundaries.
- Examples Reading BUILTIN_SPECS, mapping symbols to runtime modules, and typical call patterns.
- FAQ and troubleshooting Builtin symbol drift, signature mismatches, and codegen/runtime debugging.
- Flow and algorithm From lowering call sites through BUILTIN_SPECS to runtime C exports.
- Verification and traceability Crate paths and tests that pin builtin specs to runtime exports.
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”Generated code calls runtime entrypoints across JIT relink and AOT link. Rust panics across the boundary must use the platform unwind ABI expected by Cranelift call sites.
Decision
Section titled “Decision”| Rule | Detail |
|---|---|
| Export attribute | Implementations use #[unsafe(no_mangle)] pub extern "C-unwind" in beskid_runtime::builtins |
| Registry | RUNTIME_EXPORT_SYMBOLS lists every export the linker/JIT registers |
| Layout types | BeskidStr { ptr, len } and BeskidArray { ptr, len, cap } are normative payload headers |
| Families | Allocation, GC, fibers, channels, interop dispatch, IO, and panic share one catalog |
Consequences
Section titled “Consequences”Host tooling resolves imports by symbol name + BUILTIN_SPECS signature, not Rust mangling.
Verification anchors
Section titled “Verification anchors”compiler/crates/beskid_runtime/src/builtins/mod.rs; compiler/crates/beskid_runtime/src/lib.rs re-exports.