Part I: The Language
Part I covers the language itself: values and types, functions, control flow and pattern matching, records and enums, text, numbers and units, error handling, collections, generics, a first look at loci, and testing. Everything in this part works in standalone scripts, CLI tools, and long-lived services alike. The std::* modules for I/O, networking and telemetry are in Part II.
fn main() { let total = 19.99d * 3.0d; println("Three at $19.99 is $", total);}Key Design Differences
Section titled “Key Design Differences”- First-class financial, temporal, and physical types:
Decimal(19.99d),Duration(250ms,5s),Time, and user-defineddimension/unit/quantitytypes are built into the language rather than bolted on as wrapper libraries. - Value-level errors (
fallible(E)): Functions that can fail declarefallible(ErrType)in their signature. Callers must explicitly handle the error channel at the call site usingor(or default,or raise,or handler(err),or { ... },or discard). - Arena-backed collections (
@form): Instead of heap-allocated genericVec<T>orHashMap<K, V>values, dynamic collections are loci annotated with@form(vec),@form(hashmap),@form(set),@form(ring_buffer),@form(lru_cache), or@form(heap).
Chapters in Part I
Section titled “Chapters in Part I”| Section | Chapters |
|---|---|
| Basics | Values, Types & Variables · Functions · Control Flow & Pattern Matching · Records, Enums & Set Types |
| Data | Strings & Bytes · Numbers, Money & Time · Units of Measure · Error Handling (fallible) · Collections (@form) · Generics |
| Components & Testing | Introduction to Loci · Testing & Benchmarking |
Next: Values, Types & Variables.