Skip to content

§1 Lexical Structure

Identifiers begin with a letter or _ and may contain ASCII letters, digits, or _. Identifiers are case-sensitive. Reserved keywords may not be used as identifiers.

Keywords — see Keywords Reference for the full list with descriptions.

Literals:

KindExamplesNotes
Integer42, 0, 1_000_000Underscores allowed as separators
Float3.14, 0.5, 1.0e664-bit IEEE 754
String"hello", "line\n"UTF-8, escape sequences, {{ }} interpolation
Booleantrue, false
NullnullExplicit absence of a value

Currency literals ($0.05) are not yet parsed — use 0.05 // USD as a comment annotation. Time literals (1s, 150ms) are not yet parsed — use numeric milliseconds.

Comments:

  • // single-line
  • /* ... */ multi-line
  • /// doc comments (on declarations)

Effect annotations![effect, ...] after a function/test/pipeline signature:

fn fetch(url: string) -> string ![io, net] { ... }

Canonical effects: io, net, model, gpu, rand, clock, plus unsafe, read, mut.