Skip to content

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);
}
  1. First-class financial, temporal, and physical types: Decimal (19.99d), Duration (250ms, 5s), Time, and user-defined dimension/unit/quantity types are built into the language rather than bolted on as wrapper libraries.
  2. Value-level errors (fallible(E)): Functions that can fail declare fallible(ErrType) in their signature. Callers must explicitly handle the error channel at the call site using or (or default, or raise, or handler(err), or { ... }, or discard).
  3. Arena-backed collections (@form): Instead of heap-allocated generic Vec<T> or HashMap<K, V> values, dynamic collections are loci annotated with @form(vec), @form(hashmap), @form(set), @form(ring_buffer), @form(lru_cache), or @form(heap).
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