WCL
A typed configuration & schema language: declare types, compose a document, validate and evaluate it — one model, checked before anything consumes it.
What WCL Is
A typed configuration & schema language: declare types, compose a document, validate and evaluate it.
Fields & blocks
A named group of fields that can also nest other blocks; the schema sets its labels and fields.
- A field binds a name to a value: port = 8080u32
- A block groups fields and nests: service "web" { ... }
- Block labels map to @inline fields — structure stays data
Typed primitives
Fixed-width signed and unsigned integers plus two float widths, with literal suffixes.
- Numbers with width suffixes: 200u8, 1_000_000u32, 2.5f32
- Strings, heredocs, and $"..." interpolation
- Symbols (:amber), booleans, identifiers, references
Records, lists, tables
Named records via the type keyword — fixed sets of named, typed fields.
- Lists: tags = ["alpha", "beta"]
- Records: owner = { name: "Ops", contact: "..." }
- Pipe-tables write many rows of one shape compactly
Optionals
Values that may be present or absent — the none literal and the ? type suffix.
- T? accepts a value or none
- ?? gives an optional a default: theme ?? :nord
Unions & match
Tagged variant sets — a value that is exactly one of several alternatives.
- Status::Failed { reason: "timeout" } — tagged variants
- Bare records coerce to the matching variant by shape
- match destructures; the final arm is _ or a binding
Declaring types
Declaring nestable blocks with @block, @inline, @child/@children, and @default.
- @block("service") makes a type a nestable block kind
- @inline(0) binds the label; @default(80) fills gaps
- @child / @children declare the nesting
The @document & gathering
Marking a document root with @document, and how schemas merge per namespace.
- One @document root gathers every matching block instance
- Schemas merge per namespace — import a library's and add yours
- wcl check validates the assembled document
Functions
Functions that take and return other functions.
- fn double(n: i64) -> i64 { n * 2 }
- Literals pass to map / filter / fold
- Config that computes, still declarative at the edges
Imports & namespaces
Pull another file's declarations into the document — disk and system forms.
- import "./types.wcl" — disk; import <wdoc.wcl> — system
- namespace scopes declarations; use and :: resolve them
CLI Reference
The wcl binary: parse, check, eval, set, fmt, repl, lsp, init, wdoc, and diff.
- wcl check / wcl eval — validate and read
- wcl set / wcl fmt / wcl diff — edit, normalise, compare
- wcl repl, wcl lsp, wcl init — explore, edit, scaffold
wdoc in one slide
- wcl wdoc projects WCL data into sites, books, PDFs, and skills
- Pages, diagrams, charts, terminals — all authored as blocks
- This deck is itself a wdoc projection of the reference model
Where to go next
- Quick Start in the book: install, a minimal document, check & eval
- The Language section — area by area, with runnable examples
- The Learn WCL training course — eleven hands-on lessons