Compile-time correctness on the BEAM.
Make every case explicit
Section titled “Make every case explicit”Model your data with unions and structs. Gale checks that each case handles
every case. Add a new state, and the compiler shows you which matches need
to change.
pub type Job = Queued(id: Integer) | Running(id: Integer) | Finished
pub fn describe(job: Job) -> String { case job { Queued(id) -> "Job #{id} is waiting" Running(id) -> "Job #{id} is running" Finished -> "All done" }}Works with Elixir and OTP
Section titled “Works with Elixir and OTP”Use your Elixir libraries. Add Gale to a Mix project and call existing libraries through typed interfaces. Call generated Gale modules from Elixir like any other module.
Describe your messages. Typed mailboxes define what a process can receive. OTP behaviours connect requests to reply types and check callback signatures. Your processes run under native OTP supervision.
Check data at the boundary. Decode incoming JSON into typed values and
represent expected failures with Result. Handle success and failure
explicitly in your code.
Try Gale
Section titled “Try Gale”Gale is under active development. Follow the Quick Start to add it to a Mix project, or explore the examples in the repository’s Dev Container, which includes the compiler and Elixir toolchain:
git clone https://github.com/cloudloom-ai/gale.gitcd gale# Open in VS Code, then Dev Containers: Reopen in ContainerInside the container, run an example:
cd examples/numbersmix deps.getmix testThe tour walks through the language with runnable, tested examples, including proving contracts. The language reference lists the supported syntax, while the type system gives the formal rules.