The GALA Playground lets you write, compile, and run GALA code directly in your browser. No installation, no setup – just open it and start coding.
The playground transpiles your GALA code to Go and runs it on the server. You get real compiler output, real error messages, and real program results. It is the same transpiler that runs locally when you install GALA.
The playground comes with 9 built-in examples that demonstrate GALA’s core features. Select any example from the dropdown to load it instantly:
Some/None with Map, FlatMap, GetOrElseLeft/Right disjoint unions with monadic chainingMap, FlatMap, RecoverArray, List, HashMap with Map, Filter, FoldLefts"..." and f"..." string templatesPaste this into the playground to see sealed types, pattern matching, and string interpolation working together:
package main
sealed type Animal {
case Dog(Name string, Tricks int)
case Cat(Name string, Indoor bool)
case Fish(Species string)
}
func describe(a Animal) string = a match {
case Dog(name, tricks) if tricks > 5 => s"$name is a talented dog with $tricks tricks"
case Dog(name, _) => s"$name is a good dog"
case Cat(name, true) => s"$name is an indoor cat"
case Cat(name, false) => s"$name is an outdoor cat"
case Fish(species) => s"a $species fish"
}
func main() {
val animals = SliceOf(
Dog("Rex", 8),
Cat("Whiskers", true),
Fish("Goldfish"),
Dog("Buddy", 3),
Cat("Luna", false),
)
for _, a := range animals {
Println(describe(a))
}
}
Expected output:
Rex is a talented dog with 8 tricks
Whiskers is an indoor cat
a Goldfish fish
Buddy is a good dog
Luna is an outdoor cat
This example shows:
Dog and boolean matching on Cats"..." with embedded variables, no imports neededfunc describe(...) string = ... without braces or returnIf you like what you see in the playground, install GALA locally for full project support, Bazel integration, and multi-file packages.