Part I: Language & Standard Library
Part I covers Hale’s core syntax, type system, error handling, data structures, and built-in standard library (std::*). Everything in this part works in standalone scripts, CLI tools, and long-lived services alike.
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 |
|---|---|
| Core Language | Values, Types & Variables · Numbers, Money & Time · Units of Measure · Functions · Control Flow & Pattern Matching · Strings & Bytes · Error Handling (fallible) · Program Structure & main |
| Data & Components | Introduction to Loci · Records, Enums & Set Types · Collections (@form) |
| I/O, Networking & Web | Filesystem I/O · JSON Encoding & Decoding · HTTP Servers & Clients · TCP, UDP, Unix Sockets & TLS · Cryptography, Hashing & Randomness |
| CLI, Telemetry & Testing | CLI Arguments & Environment · Structured Logging · Metrics · Observability & Probes · Testing & Benchmarking |