Skip to content
Beskid The Beskid Book

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

11.1 Evaluation model

How Beskid callables run, how closures capture, and why there is no async surface.

Evaluation model

Evaluation in Beskid is callable-centric: functions, methods, closures—with control flow and types checked before lowering. Concurrency is explicit spawn, not hidden schedulers behind await.

  • Functions and methods are the default unit of work.
  • Closures capture environment; captures participate in GC rooting when fibers are involved.
  • See Lambdas and closures for capture rules.

The language rejects reserved async / await tokens. Structured concurrency uses:

  • spawnFiber<T>
  • Join for Result<T, FiberError>
  • Channels for cross-fiber payloads
  • WaitGroup, Hub for coordination (Concurrency package)
flowchart TB
  main[Main fiber]
  child[spawn child]
  ch[Channel T]
  join[Join handle]
  main --> child
  child --> ch
  main --> join
CrateRole
beskid_analysisSpawn typing, capture diagnostics
beskid_codegenfiber_spawn, stack maps
beskid_engine / beskid_runtimeScheduler, stacks

Evaluation

Fibers and spawn