Docs / Lexicography

2. Lexical Structure

Dryad's lexical structure is end-to-end Unicode (UTF-8). The alphabet consists of letters [a-zA-Z], digits [0-9], insignificant whitespace (except in literals and template strings), and special characters. The lexer ensures ambiguity-free interpretation.

CategoryReserved Words
Declarationlet, const
Flow Controlif, else, for, while, do, break, continue, match, in
Functions & Tasksfunction, fn, async, await, return, thread, mutex
Object Orientationclass, new, extends, this, super, static, public, private, protected
Modules & FFIimport, export, use, as, from
Exceptionstry, catch, finally, throw
Basic Literalstrue, false, null
Native Directives and Delimiters
 1 #io                     // Token NativeDirective("io")
 2 let hex = 0xFF;         // Literal hexadecimal
 3 let bin = 0b1010;       // Binary literal
 4 let octal = 0o755;      // Octal literal
 5 

Dryad supports numbers in decimal, hexadecimal, binary, and octal formats.

Found an error in the spec? Open a PR.
Official Version: 1.0 · May 2026