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.
Where to start
Section titled “Where to start”If you’re reading top-to-bottom, this is the recommended order:
- Lexical structure — comments, identifiers, numeric and string literals, reserved words.
- Preprocessor —
#include/#import,#define, conditional compilation. - Types — primitives, structs, enums, pointers, arrays, type inference, casting.
- Operators — full precedence table including the rotate (
<::>) and byte-extract (<>>>>>>) operators. - Statements & control flow — variable declaration modifiers,
if,switch, the twoforloops,while,:unroll. - Functions — declarations, tuple returns, varargs, overloading, function annotations.
- Classes — instance and stack allocation, methods, properties (getter / setter rewrites),
init/dealloc. - Inheritance & protocols — single inheritance, virtual dispatch, downcasts (
(Dog@)aand the failable(Dog@ ?)a), protocols. - Heap, ARC & weak refs —
new/delete, automatic reference counting,weak:references, manual-farc=offmode. - Inline assembly —
asm { ... }blocks, byte-extract operators, accessing xtc variables and theclobbersannotation.
For day-to-day reference, jump straight to the page you need from the sidebar.
What’s not on these pages
Section titled “What’s not on these pages”- 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.