Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Flow and algorithm

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

Step-by-step algorithms for panic and syscall builtins. Layering diagram: design model.

  1. Lowering or runtime detects unrecoverable condition (bounds check, failed alloc message).
  2. Build BeskidStr message pointer or call panic_str with empty/default handle.
  3. panic / panic_str formats diagnostic output when possible, then traps.
  4. No return to generated Beskid code (AbiReturnKind::Never).
  1. Validate fd range (non-negative, fits platform i32 where required).
  2. Read { ptr, len } from BeskidStr; null handle returns -1.
  3. On Linux x86_64, loop write syscall until buffer drained or error.
  4. Return total bytes written as i64, or -1 on hard failure.
  1. Accept fd and max byte count (i64 parameters per BUILTIN_SPECS).
  2. Allocate or fill buffer via runtime string helpers; return BeskidStr pointer.
  3. Map EOF to empty string handle per corelib contract (IO-005 in console streams).
  1. When a fiber triggers blocking syscall work, runtime may use scheduler::run_blocking to avoid blocking the scheduler thread’s mutator role incorrectly.
  2. Pool threads must not run arbitrary Beskid mutator allocations (memory contract GC-003).
  1. System.Output.Write calls WriteWith.
  2. On syscall error, corelib must panic with stable message — not Option — per console IO spec.