Skip to content

Releases: martin-k-m/twill

twill 1.4.0 — the self-hosting release

Choose a tag to compare

@martin-k-m martin-k-m released this 11 Aug 09:29

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 to twill 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 (and num_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 through x[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/load of 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

Choose a tag to compare

@martin-k-m martin-k-m released this 10 Aug 15:12

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)

  • enum declarations and match expressions — sum types and pattern matching, with wildcard and payload-binding patterns and statement arm bodies.
  • struct declarationsstruct Name { field: Type, ... }, the way the compiler declares its own types.
  • Generics in annotationsArr[I64], Dict[Str, V], Res[T, E], nested and qualified.
  • Res/Opt with postfix ? — built-in Ok/Err/Some/None and error propagation.
  • Typed record literalsPoint { x: 1.0, y: 2.0 }.
  • Field and index assignmentobj.f = v, arr[i] = v, composing.
  • Bitwise operators on I64and, or, xor, shl, shr, bnot.
  • mode systems, qualified type names, contextual unit/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

Choose a tag to compare

@github-actions github-actions released this 06 Aug 19:09

Full Changelog: v1.1.0...v1.2.0

Raster v1.1.0

Choose a tag to compare

@github-actions github-actions released this 04 Aug 18:34

Full Changelog: v1.0.1...v1.1.0

Raster v1.0.1

Choose a tag to compare

@github-actions github-actions released this 03 Aug 09:16

Full Changelog: v1.0.0...v1.0.1

Raster v1.0.0

Choose a tag to compare

@github-actions github-actions released this 03 Aug 08:03

Full Changelog: v0.26.0...v1.0.0

Raster v0.26.0

Choose a tag to compare

@github-actions github-actions released this 30 Jul 14:40
684c4e9

What's Changed

Full Changelog: v0.25.0...v0.26.0

Raster v0.25.0

Choose a tag to compare

@github-actions github-actions released this 30 Jul 10:37
83939c6

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

Choose a tag to compare

@github-actions github-actions released this 29 Jul 20:47
bf08155

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

Choose a tag to compare

@github-actions github-actions released this 29 Jul 20:28
8b237d9

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