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.

| Section | Topic | | --- | --- | | Errors and Result | Recoverable failures and ?. | | Contracts in source | contract, conformance lists, embeddings. | | Effects and purity | Compile-time vs runtime, metaprogramming boundaries. | | Panic vs contract | Traps, 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