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.
What you will find here
Section titled “What you will find here”| 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. |
By the end of this chapter
Section titled “By the end of this chapter”- Model failures with
Resultand 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).