GALA is a language that transpiles to Go source code. You get sealed types (algebraic data types), exhaustive pattern matching, Option/Either/Try/Future monads, immutable-by-default values, and functional collections — and the output is readable Go that links against any Go library.
A quick taste:
sealed type Shape {
case Circle(Radius float64)
case Rectangle(Width float64, Height float64)
}
func area(s Shape) string = s match {
case Circle(r) => fmt.Sprintf("circle area: %.2f", 3.14 * r * r)
case Rectangle(w, h) => fmt.Sprintf("rect area: %.2f", w * h)
}
This compiles to a flat Go struct with a variant tag. The compiler enforces exhaustiveness — add a Triangle case and forget to handle it, you get a compile error, not a runtime bug.The standard library is written in GALA itself: Option[T], Either[A,B], Try[T], Future[T], plus immutable List, Array, HashMap, HashSet, TreeSet, TreeMap — all with Map, Filter, FoldLeft, Collect, etc.
How I actually develop in GALA — no IDE needed:
The biggest honest gap right now is traditional IDE support. There's an IntelliJ plugin for syntax highlighting, but no LSP, no autocomplete, no go-to-definition. Here's the thing though: I built the entire language and standard library using Claude Code as my development environment. Claude knows the GALA grammar, the type system, and the standard library — it writes GALA fluently, catches transpiler errors, and suggests idiomatic patterns. For me it's been a more productive workflow than any IDE could offer for a young language. If you're already using AI-assisted development, GALA works great today. If you need traditional IDE tooling to be productive, that's a real limitation I want to be upfront about.
Some other honest notes: - This is pre-1.0. The language works (107 verified examples, CI on every commit), but I'm sure there are edge cases I haven't hit. - The transpiler is a single-developer project. It handles multi-file packages, generics, type inference, and full Go interop, but it's early. - The compiler — type inference, sealed type code generation, exhaustiveness checking — was built collaboratively with Claude as a pair programmer. Happy to answer questions about that workflow.
Technical details for the compiler nerds: GALA source → ANTLR4 parse tree → GALA AST → Go AST → Go source. Type inference resolves lambda parameter types, generic type arguments, and method return types without annotations in most cases.
Repo: https://github.com/martianoff/gala
I'm curious what people think about the sealed-type-to-flat-struct compilation approach and the tradeoffs of transpiling vs. extending Go directly.
jlongo78•1h ago
mmcodes•1h ago