Getting Started with GALA

GALA transpiles to Go, so you get native binaries, full Go library access, and the entire Go toolchain. This guide takes you from installation to a running program in minutes.


Installation

Pre-built Binaries

Download the latest release for your platform from GitHub Releases:

Platform Binary
Linux (x64) gala-linux-amd64
Linux (ARM64) gala-linux-arm64
macOS (x64) gala-darwin-amd64
macOS (Apple Silicon) gala-darwin-arm64
Windows (x64) gala-windows-amd64.exe

After downloading, rename the binary to gala (or gala.exe on Windows) and add it to your PATH.

Build from Source

If you prefer to build from source, you need Git, Go 1.25+, and Bazelisk:

git clone https://github.com/martianoff/gala.git
cd gala
bazel build //cmd/gala:gala

The compiled binary will be at bazel-bin/cmd/gala/gala_/gala.


Hello World

1. Create a project

mkdir hello && cd hello
gala mod init example.com/hello

gala mod init creates a gala.mod file; the module path is any unique identifier you choose.

2. Write

Create a file called main.gala:

package main

func main() {
    Println("Hello, GALA!")
}

Println is a built-in function – no imports needed.

3. Run

gala run main.gala

Output:

Hello, GALA!

That is it. GALA transpiles your code to Go, compiles it, and runs the binary. (Make sure Go 1.25+ is on your PATH — GALA shells out to go build under the hood.)


A Bigger Example

Here is a program that uses structs, pattern matching, and string interpolation:

package main

struct Person(Name string, Age int)

func greet(p Person) string = p match {
    case Person(name, age) if age < 18 => s"Hey, $name!"
    case Person(name, _)               => s"Hello, $name"
}

func main() {
    val people = SliceOf(
        Person("Alice", 25),
        Person("Bob", 15),
        Person("Charlie", 70),
    )

    for _, p := range people {
        Println(greet(p))
    }
}

Output:

Hello, Alice
Hey, Bob!
Hello, Charlie

Key features shown:


Project Setup

Initialize a Module

For anything beyond a single file, initialize a GALA module:

mkdir myproject && cd myproject
gala mod init github.com/user/myproject

This creates a gala.mod file that tracks your module path and dependencies.

Directory Structure

A typical GALA project looks like this:

myproject/
  gala.mod              # Module manifest
  gala.sum              # Dependency checksums (auto-generated)
  main.gala             # Entry point
  handler/
    handler.gala        # Library package
  model/
    user.gala           # Another package
    order.gala          # Multiple files per package

Multi-File Packages

GALA packages can span multiple .gala files, just like Go packages. All files in a directory share the same package name. Types, functions, and methods defined in one file are visible to other files in the same package.


Building and Running

Without Bazel (Simple Projects)

For simple projects, use gala build and gala run directly:

# Build to a binary
gala build

# Build and run
gala run

# Run a subdirectory executable that imports from the parent project
gala run examples/hello/main.gala

# Build with verbose output
gala build -v

# Clear analysis cache
gala clean --cache

gala build creates a clean build workspace under ~/.gala/build/, transpiles your GALA code to Go, and compiles it. Your project directory stays clean – no generated files. An analysis cache (.gala/cache/) speeds up repeated builds by caching resolved package metadata.

For larger projects, Bazel provides incremental builds, dependency management, and test orchestration. GALA provides three Bazel rules:

gala_binary – builds an executable:

load("//:gala.bzl", "gala_binary")

gala_binary(
    name = "myapp",
    src = "main.gala",
)

gala_library – builds a reusable package:

load("//:gala.bzl", "gala_library")

gala_library(
    name = "handler",
    src = "handler.gala",
    importpath = "github.com/user/myproject/handler",
)

gala_go_test – builds and runs tests:

load("//:gala.bzl", "gala_go_test")

gala_go_test(
    name = "handler_test",
    src = "handler_test.gala",
)

Build and test with:

bazel build //...
bazel test //...
bazel run //myapp:myapp

Adding Dependencies

Go Packages

Use any Go library by adding it with the --go flag:

gala mod add github.com/google/uuid@v1.6.0 --go

Then import and use it in your GALA code:

package main

import "github.com/google/uuid"

func GenerateID() string = uuid.New().String()

func main() {
    Println(s"ID: ${GenerateID()}")
}

GALA Packages

Add GALA library dependencies without the --go flag:

gala mod add github.com/example/gala-utils@v1.2.3

GALA dependencies are automatically transpiled at build time – no pre-compiled .go files needed.

Dependency Commands

gala mod add <package>@<version>        # Add a dependency
gala mod add <package>@<version> --go   # Add a Go dependency
gala mod remove <package>               # Remove a dependency
gala mod update                         # Update all dependencies
gala mod tidy                           # Sync gala.mod with imports
gala mod graph                          # Print dependency tree
gala mod verify                         # Verify checksums

For Bazel projects, run gala mod tidy to generate the go.mod and go.sum files that Bazel needs.

See the Dependency Management documentation for full details.


IDE Support

GALA ships with a GoLand/IntelliJ plugin and an LSP server for editor-agnostic support.

GALA syntax highlighting in IntelliJ

Quick setup

GoLand / IntelliJ IDEA:

  1. Install GALA CLI from releases and add to PATH
  2. Install plugin: Settings > Plugins > Install from Disk > select gala-intellij-plugin.zip from releases
  3. Restart the IDE — the LSP server starts automatically when a .gala file is opened

VS Code — add to .vscode/settings.json:

{
  "lsp.servers": {
    "gala": {
      "command": "gala",
      "args": ["lsp"],
      "filetypes": ["gala"]
    }
  }
}

Neovim:

require('lspconfig.configs').gala = {
  default_config = {
    cmd = { 'gala', 'lsp' },
    filetypes = { 'gala' },
    root_dir = require('lspconfig.util').root_pattern('gala.mod', '.git'),
  },
}
require('lspconfig').gala.setup({})

See the full IDE Support page for screenshots of syntax highlighting, type-aware code completion, inlay type hints, structure view, and more.


Next Steps

You are set up and running. Here is where to go from here:

Showcase Projects

Project Description
GALA Playground Web-based playground – try it live
State Machine Example State machines with sealed types and pattern matching
Log Analyzer Structured log parsing with Go stdlib interop and functional pipelines
GALA Server Immutable HTTP server library with builder-pattern configuration
GALA TUI Elm-architecture TUI framework – immutable widgets, differential renderer, async runtime
GALA Team Multi-agent Claude CLI orchestrator – Team Lead delegates to Engineers and QAs, reviews work, hands you a PR