11.4 Corelib concurrency
The corelib_concurrency package—Fiber, Channel, Join, and where to read normative API law.
Corelib concurrency
Language keywords define spawn and typing rules. Standard library types make handles usable without everyone reimplementing the same structs.
Package
Section titled “Package”Normative hub: Concurrency package.
Expected surfaces (names per spec):
Fiber<T>— spawn handle,OnCancelled, join/cancel operationsChannel<T>— cross-fiber messaging- WaitGroup, Hub — structured coordination
Corelib lives in the corelib package identity (compiler/corelib / beskid_corelib workspace)—not a random Rust crate beside the compiler.
Split of responsibility
Section titled “Split of responsibility”| Layer | Owns |
|---|---|
| Language meta — Fibers and spawn | spawn syntax, diagnostics, capture rules |
| Execution — Fiber scheduler | Stacks, scheduler, shutdown join |
| Core library — Concurrency package | User-facing structs and methods |
Workspace crates (implementation)
Section titled “Workspace crates (implementation)”Lowering and runtime tie to beskid_codegen, beskid_engine, beskid_runtime, and abfall for GC while fibers run—see Crate-to-spec anchors.