Repository navigation
GALA 0.101.0
GALA 0.101.0 Release Notes
Released: 2026-11-14
Highlights
Opt-in inout parameters and receivers arrive as phase 2 of the ownership work, with ownership checks that hold across the Go boundary, on top of a new inferred-uniqueness analysis (phase 1). Syntax errors now come from galop's recovering parser. A large batch of correctness fixes covers evaluation order, scoping, values, Try, printing and inference. The formal-methods tooling grows: a Core JSON exporter, the galaspec reference interpreter, a differential-testing harness and the gala2lean Lean translator.
Performance: the largest compile process of a cold build needs 55–59% less memory: gala-tui's test build peaks at 7.4 GB instead of 16.5 GB. A cold gala build of galop takes 135 s instead of 316 s. A gala build right after gala test now reuses the test's Go build cache: 12 s instead of 256 s on galop, with no cache growth.
Performance
Measured in one session on one machine (Windows 11, 32 cores), with the 0.100.0 and 0.101.0 release binaries back to back. Each run started with an empty private GOCACHE and GALA_HOME, with GOFLAGS=-p=2 and Go 1.24.0. The repositories were gala-tui 9ddbac5 and galop 5f73a77. Each value is the median of two runs. "Peak compile memory" is the largest peak working set of any single compile process in the build.
| Workload | 0.100.0 | 0.101.0 | Change |
|---|---|---|---|
gala-tui gala test: peak compile memory |
16.5 GB | 7.4 GB | −55% |
gala-tui gala test: wall time |
335 s | 159 s | −53% |
gala-tui gala build ./demo: peak compile memory |
9.8 GB | 4.4 GB | −55% |
gala-tui gala build ./demo: wall time |
120 s | 119 s | ≈ 0 (noisy, see below) |
galop cold gala build: peak compile memory |
9.1 GB | 3.7 GB | −59% |
galop cold gala build: wall time |
316 s | 135 s | −57% |
galop gala build after gala test: wall time |
256 s | 12 s | −95% |
galop gala build after gala test: Go cache growth |
+4.4 GB | 0 | |
galop gala test + gala build: total Go cache |
14.2 GB | 4.4 GB | −69% |
- Less generic code to compile:
EqualandCopycompile their reflective parts once, not once per type (#1069), and copy and compare fields directly (#1088). A generic type's methods that name another generic type are lowered to functions, so instantiatingArray[T]no longer drags in a wholeList[T](#1076). Together these cut the machine code Go generates for GALA's generics, which shows in memory, time and cache size. gala testandgala buildshare the Go build cache: the driver passes-trimpath, so the two commands' workspaces produce the same cache keys (#1120, #1124).- Broken files parse faster: a file with syntax errors is parsed once, by galop's recovering parser (#1059). This speeds up diagnostics and LSP keystrokes on broken code; it does not affect the builds above.
Other builds were running on the machine at the same time, so wall times are noisy. Peak memory repeated within 6% between runs, and cache sizes were identical. The gala-tui demo build's wall time varied too much to call (0.100.0: 129 s and 111 s; 0.101.0: 184 s and 53 s), even though its peak memory halved.
Breaking Changes
inoutis a reserved keyword. Programs that useinoutas an identifier must rename it (#1111).- Stricter checks may reject programs that were accepted before. Each one rejects code that compiled but misbehaved or failed later in
go build:- GALA-E0097: the
GALA_identifier prefix is reserved, alongside_gala_(#1102, #1023). - GALA-E0098: a field default cannot read a field, or a package
valspelled like a field (#1040, #1054). - GALA-E0110: a mutating pointer-receiver call on a value that cannot be addressed, including printing a field through a copy whose
Stringchanges it (#1101, #1109). - GALA-E0112–E0116:
inoutborrow, escape, receiver,Tryand interface rules (#1116, #1118). - Also new or extended: GALA-E0100 (a value whose type doesn't implement its interface slot), E0101, E0104–E0108, and the diagnostics that #1036 moved from
go buildinto GALA (Ptr for value, unknown field, unused val,ifbranch mismatch).
- GALA-E0097: the
- std:
Concatis removed fromIterable(#1027).collection_immutableConcattakes a collection of its own type (#1020).
Features
inoutparameters and receivers (ownership phase 2): an opt-in modifier on parameters, receivers, lambda parameters and function-type parameters.inout x Tlowers to a Go*Tparameter. Arguments are&place(GALA-E0111), and aninout-receiver method is called only on a mutable place (GALA-E0114) (#1111).- Borrow checks: one call never lends a place twice (GALA-E0112), an
inoutplace does not outlive its call (GALA-E0113), and aTrythunk does not use one (GALA-E0115).func(inout T)is a distinct type (#1116). - Go interop: exported
inoutfunctions keep their Go signature as copy-in/copy-out wrappers around aGALA_-prefixed body. A place is lent to a Go pointer method only through a no-retain allow-list, which a test checks against the pinned Go compiler's escape analysis. Interfaces may declareinoutmethods (GALA-E0116) (#1118).
- Borrow checks: one call never lends a place twice (GALA-E0112), an
- Inferred uniqueness (ownership phase 1): per-function borrow summaries and per-binding uniqueness, recorded in package metadata and conservative at the Go boundary. Nothing reads them yet, so generated Go is unchanged (#1103).
- Recovering parser: a file with syntax errors is parsed once, by galop's recovering parser, which produces the errors, hints and recovered tree. ANTLR no longer re-parses broken files. It remains as the
--parser antlrengine and as the fallback after a galop panic. A parity test holds both engines to the same errors (#1059). - Language:
- Printing: shorthand structs print as
Name(field, ...), and sealed cases print like structs (#1034, #1052). Pointer-receiverStringmethods are honoured for addressable values, collections and generics (#1073, #1070). Go struct pointers print as&{...}(#1060).
Formal methods and testing
This work is differential testing and translation. The transpiler is not formally verified. One totality theorem (eval_total) is proved, about the generated translation of one test program. Theorems without content were removed (#1112).
- Core JSON exporter for subset S1, now at v6 with generics, type parameters, imports, named arguments, defaults, lambdas and interpolation (#1012, #1049, #1057, #1058, #1117).
- galaspec, a Lean reference interpreter for S1, and difftest, a harness that compares it with the transpiler (#1028, #1032, #1056).
- gala2lean, a deterministic GALA-to-Lean translator used as a third oracle. It now covers closures, interpolation, defaults, Option/Either, methods,
inoutreceivers, generic functions, structs and sealed types (#1097, #1110, #1114, #1119, #1125). - A Lean project with a match-lowering model, an opt-in Bazel build through
rules_lean, and a pinned, SHA-256-verified toolchain (#1009, #1031, #1022). - Metamorphic fuzz targets for alpha-renaming, evaluation order and past bug shapes (#1013).
Bug Fixes
- Evaluation order: left-to-right evaluation, source-order named arguments, and callee-scope defaults. Operands read through pointers, slice and map element reads, and compound assignment targets are now ordered too (#1018, #1080, #1092, #1096, #1099).
- Scoping and hygiene: match pattern variables are scoped to their case, and generated names are kept apart from user names. Builtin-named declarations are renamed, and hoisted bindings never spell an unimportable type (#1014, #1016, #1051, #1037).
- Values: sealed
CopyandEqualwork on the active case, and==on a comparableTcompares by value. A defaultednilargument takes its parameter's type. Expected types reach untyped constants (#1019, #1079, #1017). - Try:
Tryof a GALA call returningerrorfails on that error, and a panic in a combinator becomes aFailure. Future combinators andif/matchTry thunks are fixed (#1015, #1010, #1035). - Strings:
%is literal text ins"..."(#1055). - Struct literals: a field named like a std symbol (
Pair{Left: 1}) resolves as a field name (#1122). - Other fixes: EmbeddedFS as a type, spread printing, and Go alias-chain fields (#1087). Collection methods run their function once per element (#1074).
Improvements
- Build:
rules_galagoes from 0.6.5 to 0.6.12. From 0.6.9, generated Go may import packages reached through a dep (#1098, #1100), and the strict-deps workarounds are removed (#1107). galop goes to 0.3.2.
Documentation
- The ownership design, including the interop decisions and the phase 3 (non-escaping closures) design.
- The formal-semantics design and a roadmap toward an end-to-end proof.
Full Changelog: 0.100.0...0.101.0