Skip to content

Language reference

xtc is a small, statically-typed language with C-family syntax and a focus on producing dense code. The language is small enough that the reference fits in ten short pages.

If you’re reading top-to-bottom, this is the recommended order:

  1. Lexical structure — comments, identifiers, numeric and string literals, reserved words.
  2. Preprocessor#include / #import, #define, conditional compilation.
  3. Types — primitives, structs, enums, pointers, arrays, type inference, casting.
  4. Operators — full precedence table including the rotate (<: :>) and byte-extract (< > >> >>>) operators.
  5. Statements & control flow — variable declaration modifiers, if, switch, the two for loops, while, :unroll.
  6. Functions — declarations, tuple returns, varargs, overloading, function annotations.
  7. Classes — instance and stack allocation, methods, properties (getter / setter rewrites), init / dealloc.
  8. Inheritance & protocols — single inheritance, virtual dispatch, downcasts ((Dog@)a and the failable (Dog@ ?)a), protocols.
  9. Heap, ARC & weak refsnew / delete, automatic reference counting, weak: references, manual -farc=off mode.
  10. Inline assemblyasm { ... } blocks, byte-extract operators, accessing xtc variables and the clobbers annotation.

For day-to-day reference, jump straight to the page you need from the sidebar.

  • Compiler flags, optimisation levels, memory-model selection live in Compiler usage — they shape the output but aren’t part of the language.
  • Standard library classes (Stdio, Math, Heap, Vbi, Assert, …) live in the Standard library reference.
  • Memory-model internals (zero-page layouts, bank windows, PORTB encoding) are summarised throughout the language pages where they affect semantics, but the full diagrams and per-layout notes live in Compiler usage → Memory models.