Language reference
This book states the rules of the language precisely. It is distilled from
the normative specification (resid_specification.txt, version 3.6) and
kept in step with the compiler: every complete example is compiled and run
when the documentation is built.
Laws. The specification opens with the laws the rest follows:
- Everything begins as compile-time reducible.
- The compiler must reduce all provable computation.
- Unknown information must be explicitly introduced.
- Residual computation enters through
rt. - Compile-time computation cannot depend on unresolved residual information.
- The compiler preserves knowledge whenever possible.
- Residual dependencies should be minimized.
- Authorized external knowledge enters through providers.
- Knowledge acquisition is an effect.
- Effects determine reducibility.
- External information has provenance.
- Runtime uncertainty is explicit.
- Knowledge is first-class.
- Authority is never ambient and may only be attenuated, never amplified, across trust boundaries.
Non-goals, on purpose: mutable values or bindings, shadowing,
assignment operators, null, ambient authority, hidden identity,
trait or interface systems, programmer-controlled allocation, exceptions
outside concurrent Result, implicit numeric conversions, operator
overloading beyond behaviors, unstructured concurrency, raw target
intrinsics, method chaining on plain values, and amplification of
authority across sandboxes.
