Skip to content
Beskid The Beskid Book

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

10.3 Ownership preview

What Beskid takes from ownership thinking without importing Rust's borrow checker wholesale.

Ownership preview

Rust’s ownership story is brilliant for Rust. Beskid’s story is: GC + static rules + spawn capture checks—enough discipline to avoid the worst footguns without forcing <'a> on business logic.

IdeaBeskid expression
Aliasing mattersref / out, mut on bindings
Cross-thread/fiber safetyChannels only; StackReferenceEscapesSpawn diagnostic
Boundaries are explicitextern, manifests, ABI profiles
  • Move-only default for every value
  • Lifetime parameters on every struct
  • unsafe blocks in application code as a daily tool

The compiler host is Rust (beskid_analysis, beskid_runtime, …) and uses Rust’s ownership internally. Your Beskid sources target the language memory model, not rustc’s borrow checker.

Closures capture environment values; the compiler roots captures for GC when lowering spawn. If a capture would let stack memory outlive its frame across fibers, you get a diagnostic—not a silent segfault gift basket (Fibers and spawn semantic rules).

Put it behind extern / native libraries with a documented ABI profile, or contribute to compiler/crates/—do not demand unsafe in Beskid because C# had unsafe and nobody learned anyway.

Memory and references

Unsafe and extern preview