Skip to content
Beskid The Beskid Book

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

10.4 Unsafe and extern preview

User FFI surfaces, extern contracts, and where unsafe actually lives (hint: the Rust host).

Unsafe and extern preview

Preview means read the spec before you ship. User Beskid is not a daily unsafe language; interop is [Extern] contracts, manifests, and profiles.

Normative hub: FFI and extern.

flowchart LR
  beskid[Beskid callable]
  abi[ABI profile rules]
  native[Native library or runtime export]
  beskid --> abi --> native

Inside compiler/crates/beskid_runtime, builtins use #[unsafe(no_mangle)] pub extern "C-unwind"—see Builtins and symbols. That is platform maintenance, not a tutorial pattern for app authors.

beskid_engine may expose platform-specific dynamic resolution paths marked Proposed in spec—do not assume Standard behavior without reading the profile ADRs (C ABI dynamic resolution).

If you typed unsafe because you were angry at the type checker, stop. If you need native code, write a thin extern boundary and test it like an adversary.

11. Fibers: cheaper than threads, still scary