Releases: martin-k-m/twill
Release list
twill 1.4.0 — the self-hosting release
The compiler written in twill now runs on the Go bootstrap and performs every stage — lex, parse, check, format, evaluate, and the differential canonical dump — matching the Go reference implementation.
Self-hosting reaches the whole pipeline
check— matches the Go command byte-for-byte on all 443 corpus files (src/,std/,examples/,testdata/).fmt— matches on all 89 source files, save one by-design divergence (twill's formatter preserves blank lines between statements; the Go formatter strips them).run— the self-hosted evaluator runs the entire example corpus with output identical totwill run: autodiff, jacobians, hessians, neural-net training (records, MLP, XOR, CNN, attention), minibatching with a shuffled data pipeline, gradient-boosted trees, and Monte Carlo option pricing.run --dump=canonical— the differential harness's bit-exact dump is emitted in twill too, matching Go on the value-independent programs.
The whole src/ + std/ tree type-checks clean.
Under the hood
Getting the two implementations to agree meant building the systems runtime the evaluator needs and closing every gap between them:
- Numbers: native
str_to_f64/f64_to_str(andnum_to_text,f64_hex) so the interpreter — whose numbers are float64 — reads and prints every literal exactly, instead of the pure-twill decimal machinery that needs an exact 64-bit integer. - Evaluation: tensor operators, string concatenation,
import, traced slices (so gradients flow throughx[i:j]), and a native model-handle bridge for gradient boosting were all wired into the self-hosted evaluator. - Correctness: comparison results are F64 (matching the reference, not a bool-packed buffer);
I64-annotated bindings truncate integer division so the ported tensor kernels index correctly; scalar ordering comparisons work on rank-0 tensors without breaking autodiff.
Known limitations
- Two 1-ULP float-accumulation differences (a hessian's canonical dump; a gradient-boosting regression RMSE), from matmul/reduction accumulation order.
save/loadof a foreign gbm model or a tensor record does not yet round-trip through the evaluator.
🤖 Generated with Claude Code
twill 1.3.0 — the systems-mode front end
twill 1.3.0 — the systems-mode front end
mode systems is the dialect twill is being rewritten in, on the way to a self-hosted compiler. In 1.3.0 the Go bootstrap parses, type-checks and formats all of it: every file in src/, std/, examples/ and testdata/ — the whole self-hosted compiler and standard library included — now goes through the front end cleanly.
Language features (each mirrored into the self-hosted compiler in lockstep)
enumdeclarations andmatchexpressions — sum types and pattern matching, with wildcard and payload-binding patterns and statement arm bodies.structdeclarations —struct Name { field: Type, ... }, the way the compiler declares its own types.- Generics in annotations —
Arr[I64],Dict[Str, V],Res[T, E], nested and qualified. Res/Optwith postfix?— built-inOk/Err/Some/Noneand error propagation.- Typed record literals —
Point { x: 1.0, y: 2.0 }. - Field and index assignment —
obj.f = v,arr[i] = v, composing. - Bitwise operators on I64 —
and,or,xor,shl,shr,bnot. mode systems, qualified type names, contextualunit/type, and grouped multi-line continuation.
Notes
- Running the self-hosted compiler on the bootstrap is the next step and is not yet done; what remains is the systems-mode runtime primitive library.
- The array/ML language the bootstrap has always been — tensors, autodiff (forward and reverse mode), the shape checker, the formatter, the CLI — is unchanged and fully backward compatible. Files written by earlier versions still load.
See CHANGELOG.md for the full list.
Raster v1.2.0
Full Changelog: v1.1.0...v1.2.0
Raster v1.1.0
Full Changelog: v1.0.1...v1.1.0
Raster v1.0.1
Full Changelog: v1.0.0...v1.0.1
Raster v1.0.0
Full Changelog: v0.26.0...v1.0.0
Raster v0.26.0
What's Changed
- v0.26.0: differentiable element indexing by @martin-k-m in #15
Full Changelog: v0.25.0...v0.26.0
Raster v0.25.0
What's Changed
- v0.25.0: second-order autodiff through structural ops by @martin-k-m in #14
Full Changelog: v0.24.1...v0.25.0
Raster v0.24.1
What's Changed
- qa: verify second-order engine + fix its training-hot-path overhead by @martin-k-m in #12
- v0.24.1: ship the second-order QA perf fix in release binaries by @martin-k-m in #13
Full Changelog: v0.24.0...v0.24.1
Raster v0.24.0
What's Changed
- v0.24.0: second-order autodiff (exact Hessians) by @martin-k-m in #11
Full Changelog: v0.23.0...v0.24.0