A typed, lazy expression and declaration language.
One grammar, one parser, and one bytecode evaluator for interactive lines and pure declarative files, with checked physical units, strict overrides, and canonical formatting.
let
base = { host = "cache.modus.systems", memory = 64 MiB, timeout = 250 ms },
cfg = base with { memory = base.memory + 512 KiB }
in
[cfg.host, "${cfg.memory}", "${cfg.timeout}"] |> join_text(" · ")
"cache.modus.systems · 66048 KiB · 250 ms"-
Language Reference
Complete grammar, console and declaration evaluation modes, values, operators, destructuring, pattern matching, and refusals.
-
Standard Library & Units
Exact checked size and duration units and all 26 pure standard functions for lists, records, text, and assertions.
-
Declarations & Metadata
Lazy
lexicon,plan, andrecipegraphs,describedmetadata, SPDX license validation, and canonicalpins.lex. -
Formatting & Linting
Idempotent canonical source formatting with
lex fmtand two-pass static diagnostics withlex lint. -
CLI & Embedding
The standalone
lexcommand, lossless JSON projection with--json, and embedding the freestanding packages. -
Sources & Credits
Language lineages, virtual machine engineering, cryptography, refused designs, typography, and licenses.
Build from source
Pre-1.0. Source is on GitHub.
nix develop
odin run tools/lextool -collection:lex=src -- build
./build/lex eval -e '1 MiB + 512 KiB'
For agents
Point your coding agent at the evaluator-verified SKILL.md before writing or editing Lex expressions and .lex files.
Read https://lex.modus.systems/SKILL.md before writing or editing Lex code or .lex files. Follow its syntax, unit, and strict `with` rules, and verify files with `lex fmt --check`, `lex lint`, and `lex eval`.