SML 0.6.3 is out
2026-10-13
The library (swsml 0.6.3) and the CLI (smltools 0.2.2) are live; the VS Code extension is 0.4.3. This round is about contracts: from "one contract per block" to "several contracts per block", plus contract inference and error positions.
- Contract mixin: a block can now apply several contracts — `@is A, B`, `@is A B` and the block-level spelling are exactly equivalent; strict wins, the result is order-independent, and a conflict raises E-CONTRACT-016. Rust only for now; the other four implementations fail loudly with E-CONTRACT-017 instead of silently returning a tree.
- Contract map API: with trace_contracts enabled, a program can ask "which contracts apply to this entity?" — and the interchange form of that map is SML itself. With the option off, the output is byte-for-byte what it was.
- Contract inference: smltools --infer-contract reverse-engineers a draft @contract from data instances (sub-contracts and array element unification included). It never guesses default / enum / ranges, and the output is deterministic and golden-testable.
- Errors carry a position: a `[line N, column M]` suffix is appended to the message; existing wording is untouched. File entry points (parse_file) carry no position — an include merges token streams across files, so missing is better than wrong.
- Fixes: a ceiling on pattern quantifiers and compiled-program size (a rule like `次: 999999999` no longer expands until the process OOMs or hangs), `required` is OR-ed when merging contracts, smltools moved onto a 64 MB stack thread (it overflowed at 70 nesting levels), and an empty include base directory now falls back to the current directory.
- Docs: a "30 seconds" section in both READMEs, a new §5.4.1 on mixins and a ch14 capability map in the textbook; and from this round on the changelog is maintained in English as well (CHANGELOG.en.md).