Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Reference

This guide is the tour. The canonical contract — what the compiler actually enforces — lives in the spec/ directory at the repository root. When the guide and the spec disagree, the spec wins; when you need the exact rule, an edge case, or a diagnostic’s meaning, go there.

The spec, by topic

You wantRead
The formal grammarspec/grammar.ebnf
Lexical structure, literals, operatorsspec/tokens.md
Operator precedence & associativityspec/precedence.md
Operational semantics (lifecycle, bus, recovery, fallible)spec/semantics.md
The type systemspec/types.md
Memory: regions, capacity slots, projection classesspec/memory.md
The form library (vec / hashmap / ring_buffer)spec/forms.md
The always-loaded runtimespec/runtime.md
The standard library surfacespec/stdlib.md
Idiomatic patterns & the six shapesspec/styleguide.md
The FFI contract — C (@ffi("c")) and the WASM host interface (@ffi("js") / @export)spec/ffi.md
Dependencies & vendoringspec/packages.md
Project layout & importsspec/projects.md
How tests are written and runspec/testing.md
Why every design choice was madespec/design-rationale.md

Two more anchors

  • AGENTS.md — the load-bearing prompt for agents writing .hl. It condenses the six idiomatic patterns, the “what’s not in the language” reflexes, and the formal design model into one file. Excellent for a human, too.
  • Working programscrates/hale-codegen/tests/fixtures/examples/ holds ~70 small per-feature programs, numbered. Reading a few near your target shape is the fastest way to see real, compiling Hale.

Toolchain commands

CommandDoes
hale run <file/dir>compile + run (fast feedback)
hale build <file/dir>compile to a native binary
hale checkparse + typecheck only
hale testrun *_test.hl
hale fetchclone & pin git dependencies
hale fmtcanonical formatter