Language specification

The rules of the language, one page per part. The sidebar and the Previous and Next links follow the order below.

  • Overview The purpose of the language, its design decisions and a core program.
  • Lexical conventions The source text: encoding, comments, doc comments, literals and heredocs.
  • Syntax The grammar in EBNF, with the statements and the precedence of expressions.
  • Modules File modules, imports and re-exports, constants, and packages.
  • Semantics Types, scope, functions, pattern matching, generics and the collections.
  • Builtins Method calls on builtin types, the rules for JSON, builtin discovery, the sandbox flags and the bytecode cache.
  • Tasks and tests The rules for tasks, channels, shared tables and unit tests.
  • I/O and network The rules for networking, logging, files, processes and native code.
  • Diagnostics The format of each error, and the stable codes that agents rely on.
  • Examples Example programs that show the design, and programs that must be rejected.