Error model specification
Decision summary
Section titled “Decision summary”- No exceptions and no hidden control flow.
- Errors are expressed explicitly as
Option[T](per language spec). - Runtime
panicis reserved for unrecoverable faults.
This chapter defines runtime-side failure behavior at execution boundaries.
Language-level error typing remains canonical in docs/spec/error-handling.md.
Error propagation
Section titled “Error propagation”- Functions return
Option[T]when errors are expected. - Callers must explicitly handle
none. - No implicit propagation (
?-style) unless the language introduces a specific operator later.
Panic behavior
Section titled “Panic behavior”panic(msg)is a runtime builtin.- Lowering inserts a call to
panicfor unrecoverable runtime conditions (e.g., bounds checks if enabled). panicterminates execution (trap).
Diagnostics
Section titled “Diagnostics”- Compile-time errors are reported via semantic diagnostics (HIR stage).
- Runtime errors use
panicwith message + span context when possible.
Non-goals
Section titled “Non-goals”- Defining source-language syntax for error handling forms.
- Defining build/deployment policy for backend artifacts.