Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Contracts and edge cases

Platform spec article

Contracts and edge cases

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki
IDRequirement
BLT-001Every BUILTIN_SPECS entry must have exactly one #[unsafe(no_mangle)] export in beskid_runtime with the same symbol string.
BLT-002RUNTIME_EXPORT_SYMBOLS must be a superset of all builtin symbols plus beskid_runtime_abi_version.
BLT-003panic and panic_str must use AbiReturnKind::Never; callers must not expect return values.
BLT-004Pointer parameters must refer to GC-tracked or ABI-documented structs (BeskidStr, headers); null unless the specific builtin documents otherwise.
BLT-005Fiber join builtins must distinguish status-only (fiber_join_status) vs value (fiber_join_value) per symbol names in symbols.rs.
BLT-006Channel receive must expose status vs value as separate symbols (channel_receive_status, channel_receive_value) to avoid ambiguous CLIF signatures.
SymbolParamsReturns
allocptr, ptr (size, type desc)ptr
str_newptr, ptr (data, len)ptr
syscall_writei64, ptr (fd, BeskidStr)i64
gc_write_barrierptr, ptrvoid
fiber_spawn(see builtins.rs)i64 fiber id
interop_dispatch_ptrptrptr

Full table: compiler/crates/beskid_abi/src/builtins.rs.

CaseRule
array_new without arrays_backingHeader allocated; ptr field null; array_len still reports logical length
Null BeskidStr in syscall_writeReturns error sentinel (-1) per IO runtime
Test helpers test_bytes_*Only for compiler tests; not a stable user API
Metrics exportsGated by metrics feature; not in baseline RUNTIME_EXPORT_SYMBOLS unless enabled at build