Skip to content
Beskid The Beskid Book

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

09. Contracts, effects, and other polite threats

Structural contracts, Result-based errors, compile-time effects, and when panic is someone else's problem.

Contracts, effects, and other polite threats

A contract in Beskid is not a PDF your manager signs. It is a structural interface your type implements—or a compile-time mod SDK surface the host discovers from AOT artifacts. Mixing those up is how you get polite threats that compile.

Normative law: Contracts and effects. This chapter translates it without watering down the MUSTs.

SectionTopic
Errors and ResultRecoverable failures and ?.
Contracts in sourcecontract, conformance lists, embeddings.
Effects and purityCompile-time vs runtime, metaprogramming boundaries.
Panic vs contractTraps, FFI, and why throw stayed dead.
  • Model failures with Result and enums, not exceptions cosplaying as control flow.
  • Declare structural contracts and implement them on types.
  • Know where panic is defined (runtime/FFI) vs where contracts are checked (static).

Errors and Result

10. Memory without another billion-dollar mistake