Repository navigation
Minor version: backwards-compatible language additions plus editorial clarifications. Modules targeting 1.0 are unaffected; a module that uses a 1.1 feature SHOULD declare "version": "1.1".
Added
switch()expression function (§8.6) — a flat multi-way conditional:switch(test1, value1, test2, value2, …, default). Returns the value paired with the first truthy test, or the trailing default. Eliminates the deeply nested ternaries that are the dominant source of unbalanced-paren errors in generated modules.random()andrange()functions (§8.6, §8.6.1) —random()→ a double in[0, 1),random(min, max)→ an inclusive integer;range(n)/range(start, end)build an integer sequence.rangepairs withmapto generate structured data declaratively.randomis nondeterministic and must be used in an action/lifecycle value, never a render binding.- Collection functions (§8.6) — positional array edits
setAt(arr, i, v),removeAt(arr, i),insertAt(arr, i, v)(negative indices count from the tail), and dictionary utilitieskeys(dict),values(dict),removeKey(dict, k). All return a new value. Positional array editing is the missing piece for piece-moving board games and index-addressed grids. aiaction (§10.11) — calls an AI provider and binds the result into the module, the foundation for AI-driven backends (a game opponent, summarization, on-the-fly data shaping). Provider-agnostic: the model, prompt, and response schema live in the requestbody; the API key is injected by the host repository's auth interceptor, never in JSON.
Clarified (editorial; runtime behavior unchanged)
- Chained ternaries take no parentheses (§8.5) — the ternary is right-associative with lowest precedence, so
a ? b : c ? d : echains natively; the flat form is canonical. style.shape.stroke(§7.9) —contentaccepts the same value forms asfill, including{ "gradient": ... }directly as the discriminator.
Previous spec revisions remain available: spec/v1.0.md.
Full normative spec: spec/v1.1.md · LLM edition: spec/v1.1-ai.md