zane v0.15
Zane
Zane is a systems programming language. Its compiler keeps the intent you write down and turns strict rules into speed, so programs get deterministic memory management with no garbage collector and no lifetime annotations.
This repository holds zane, the command you use to work with Zane: it creates projects, fetches their dependencies, installs compilers, and builds, runs and tests programs.
[!NOTE] Maintainer here: Zane is still very young and in its experimental phase. This means stuff may break a lot while its major version is zero. I am also using AI heavily to iterate quickly and test out different approaches to problems; again, because Zane is still experimental. However, this doesn't mean I'm not involved. Zane started with the idea…
Read more
…of creating a language that doesn't have GC pauses, doesn't require manual management and doesn't need lifetime annotations (these goals mainly come from audio dsp). In December 2025 I started thinking more seriously about bringing it to life. So that's when I started with the language design. I didn't know much at the time, but as I researched more and more, I gathered a lot of knowledge which ultimately enabled me to make a great language. Once I had too many ideas, I couldn't really spend a lot of time writing nice documents about them. So I decided to use AI to record my ideas in the spec repo. This also meant that I could now keep the history of my decisions (which I find particularly important) as I didn't need to write them myself. I decided to spend extra time on the spec, as I wanted to have a well thought out language. I spent roughly 3/4 year designing the language, which shows how much thought went into it. The compiler was then made with substantial AI assistance too, because it meant that I had more flexibility in changing things up and I could explore different paths to the destination. Importantly, without AI I wouldn't have had the capacity to make a compiler in the first place, unless I decided to stick with an idea and never change something up, which directly goes against my philosophy.
A taste of Zane
package hello;
import core$;
type Point = struct {
x Int;
y Int;
}
Point(x Int, y Int) => init{ x; y; }
/// A method: `this` is the point it is called on.
Int steps(this Point) => this.x + this.y;
Unit main() {
console Console(@program$console);
console!print("Hello, Zane!");
p Point(Int(3), Int(4));
far Bool = if(Int(5) < p:steps()) {
console!print("far away");
}
far:else() {
console!print("close by");
}
i Int = Int(1);
i!to(Int(3)) {
console!print("tick");
}
return Unit();
}
A few things that stand out:
- A variable is written name first, then its type:
x Int,p Point(…). A function starts with what it returns:Int steps(…). Int,Bool,if,elseand thetoloop are ordinary code from thecorepackage, written in Zane. The language itself has noiforwhilekeyword.- A call says what it may do to its subject:
p:steps()only readsp, whileconsole!print(…)andi!to(…)may change theirs. - The console is an object handed to you by the program (
@program$console), so code that has no access to it cannot print.
Install
On Linux x86_64 or macOS on Apple Silicon:
curl -fsSL https://github.com/zane-lang/zane/releases/latest/download/install.sh | sh
This puts zane in ~/.local/bin. Add that directory to your PATH if it is not there yet (export PATH="$HOME/.local/bin:$PATH" in ~/.bashrc or ~/.zshrc).
On Windows x86_64, in PowerShell:
& ([scriptblock]::Create((Invoke-RestMethod https://github.com/zane-lang/zane/releases/latest/download/install.ps1)))
Both installers check the download's SHA-256 and need no administrator access; how to pick another directory or version is in docs/releasing.md. You can also take the binaries from Releases and read the scripts before running them.
Then install a compiler:
zane toolchain install
zane --version
Compiler releases are packaged for Linux x86_64, macOS (Apple Silicon and Intel) and Windows x86_64. Each one brings everything it needs to build programs for all three systems, so you install no C compiler or LLVM yourself.
Your first project
zane init hello --yes
cd hello
zane run
zane init creates a project that pins the newest installed compiler, with a program in bin/hello/main.zn; zane run builds it and prints hello world.
To write code like the example above, add the core package and replace bin/hello/main.zn with the example (keeping package hello; as its first line):
zane add https://github.com/zane-lang/core --from-source
zane run
A library project keeps its code in lib/ and its tests in test/:
zane init geometry --lib --name math --yes
cd geometry
zane test
Everyday commands
| Command | What it does |
|---|---|
zane init [dir] |
Create a project (--lib for a library) |
zane check |
Type-check the project without building it |
zane build [program] |
Build programs from bin/ into out/ |
zane run [program] |
Build a program and run it |
zane test [test] |
Build and run the test packages in test/ |
zane add <url> [tag] |
Depend on a library |
zane update [key [tag]] |
Move dependencies to a newer tag |
zane remove <key> |
Drop a dependency |
zane tree |
Show what the project depends on |
zane toolchain install [version] |
Install a compiler |
zane toolchain update [version] |
Move the project to another compiler |
zane self update [version] |
Update zane itself |
zane help lists every command. What each one does, and why, is in docs/design/cli.md.
Compilers and projects
Each project pins its compiler in zane.coda (zane-version) and zane-lock.coda, and zane runs the installed toolchain of that version for it. Compilers are installed side by side in ~/.zane/toolchains/, so projects on different versions work next to each other; installing a newer compiler changes no project until you run zane toolchain update in it.
To use a compiler you built yourself, point zane at it:
export ZANE_COMPILER=/absolute/path/to/zanec
$env:ZANE_COMPILER = 'C:\path\to\zanec.exe'
ZANE_COMPILER comes before the pinned toolchain, and when that toolchain is not installed, zane falls back to a zanec on PATH. Neither is checked against the project's pin.
Learning the language
There is no tutorial yet. The language is described in the specification. A good order to read it in:
foundations.md: the ideas the rest of the language rests onsyntax.md: what each construct looks liketypes.mdandfunctions.md: types, constructors and methodsmemory.mdandeffects.md: ownership, references, and what a call may changepackages.md: how a project is laid out
Every spec document has a matching design story in stories/ that tells why the language looks the way it does. The core tests are the largest body of working Zane code.
The other repositories
| Repository | What it is |
|---|---|
compiler |
zanec, the compiler that zane runs |
spec |
The language specification and its design stories |
core |
The core and math packages: numbers, text, lists, control flow |
zane-nvim |
Neovim support |
coda |
The configuration format of zane.coda and other Zane files |
Building zane from source
zane is written in Crystal. The toolchain comes from devbox:
git clone --recurse-submodules https://github.com/zane-lang/zane
cd zane
devbox run -- just build # build/zane
devbox run -- just test # the specs
just with no arguments lists every recipe. How a release is published is in docs/releasing.md.
License
zane is under the MIT license; see LICENSE. The compiler it installs has its own license, in zane-lang/compiler.
zane
- 3
- 0
- 2
- 0
- 0
- 1 day ago
- October 1, 2026
MIT License
Wed, 11 Nov 2026 15:09:48 GMT