Skip to content

GALA 0.101.0

Choose a tag to compare

@martianoff martianoff released this 14 Nov 23:38
· 459 commits to master since this release
45e5e3d

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: Equal and Copy compile 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 instantiating Array[T] no longer drags in a whole List[T] (#1076). Together these cut the machine code Go generates for GALA's generics, which shows in memory, time and cache size.
  • gala test and gala build share 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

  • inout is a reserved keyword. Programs that use inout as 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 val spelled 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 String changes it (#1101, #1109).
    • GALA-E0112–E0116: inout borrow, escape, receiver, Try and 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 build into GALA (Ptr for value, unknown field, unused val, if branch mismatch).
  • std: Concat is removed from Iterable (#1027). collection_immutable Concat takes a collection of its own type (#1020).

Features

  • inout parameters and receivers (ownership phase 2): an opt-in modifier on parameters, receivers, lambda parameters and function-type parameters. inout x T lowers to a Go *T parameter. Arguments are &place (GALA-E0111), and an inout-receiver method is called only on a mutable place (GALA-E0114) (#1111).
    • Borrow checks: one call never lends a place twice (GALA-E0112), an inout place does not outlive its call (GALA-E0113), and a Try thunk does not use one (GALA-E0115). func(inout T) is a distinct type (#1116).
    • Go interop: exported inout functions keep their Go signature as copy-in/copy-out wrappers around a GALA_-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 declare inout methods (GALA-E0116) (#1118).
  • 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 antlr engine and as the fallback after a galop panic. A parity test holds both engines to the same errors (#1059).
  • Language:
    • Type-parameter constraints with type arguments (F-bounded) (#1053).
    • A function type as an explicit type argument (#1041).
    • == calls a Go type's Equal(T) bool (#1050).
    • A self-typed Iterable[T, C] (#1045).
    • Generic methods infer constraint-only type parameters (#1072).
  • Printing: shorthand structs print as Name(field, ...), and sealed cases print like structs (#1034, #1052). Pointer-receiver String methods 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, inout receivers, 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 Copy and Equal work on the active case, and == on a comparable T compares by value. A defaulted nil argument takes its parameter's type. Expected types reach untyped constants (#1019, #1079, #1017).
  • Try: Try of a GALA call returning error fails on that error, and a panic in a combinator becomes a Failure. Future combinators and if/match Try thunks are fixed (#1015, #1010, #1035).
  • Strings: % is literal text in s"..." (#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_gala goes 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