Version 0.21.5. New: one-command install for Windows, Linux, and macOS, and gg update. What changed

Systems speed.
Readable ownership.

Greengold is a statically typed systems language that compiles to native code through LLVM. Ownership is three words on a parameter, mutability is inferred, and every diagnostic can carry a checked fix.

$ gg run hello.gg
account.gg
struct Account:
    owner: string
    balance: i64

fn show(a: read Account):
    print(a.owner, a.balance)

fn deposit(a: lend Account, amount: i64):
    a.balance += amount

fn close(a: consume Account):
    print("closed", a.owner)

fn main():
    acct = Account{ owner: string.from("Ada"), balance: 100 }
    deposit(acct, 50)
    show(acct)
    close(acct)

The mode is written once, on the parameter. The call stays f(x). After close, acct is gone.

9 / 18
workloads where Greengold beat both C++ and Rust
17 / 18
ahead, or within 5% of the faster of the two
3
ownership words: read, lend, consume

What the language does

Native code, value types, and no garbage collector. Six choices define how Greengold reads and fails.

Ownership without lifetimes

Parameters say read, lend, or consume. A stored reference is tied to the place it came from. There is no lifetime syntax.

Native speed through LLVM

Release builds keep bounds and overflow checks and still finish within 5% of C++ and Rust, or ahead of both, on 17 of 18 workloads.

Mutability is inferred

Variables can change by default. One that never changes is treated as fixed, and the editor shows it as an inlay hint.

Failures are loud

Integer overflow, division by zero, bad shifts, and out-of-bounds indexes trap, in debug and in --release.

One way to write it

One spelling for each construct, one specification, and a list of rejected forms. People and language models read the same language.

Ownership is three words

The mode is written on the parameter, never at the call.

read

A shared borrow. The function may read, not assign. The caller keeps the value.

fn show(a: read Account):
    print(a.balance)
lend

An exclusive borrow. The function may change the value in place; nothing else may touch it during the call.

fn deposit(a: lend Account, n: i64):
    a.balance += n
consume

Takes ownership. After the call the argument is gone, and using it again is a compile error.

fn close(a: consume Account):
    print("closed")

A bare parameter of a heap type gets its mode from the body: read when the body only reads it, lend when it changes it, consume when it moves it. Write the mode only when you want to pin it in the signature.

Bindings

Variables can change. The ones that don't are marked for you.

There is no var and no mut on locals. Every variable can change. A variable that nothing changes is treated as fixed, and your editor shows the inferred word as an inlay hint.

  • Write fixed to turn the inference into a guarantee.
  • Assigning, lending, or mutating a fixed value is a compile error.
  • Writing var is an error that tells you to delete it.
main.gg — inlay hints on
fn main():
    fixed limit = 3
    total = 0
    for i in 0..limit:
        total += i
    fixedname = "gg"
    print(name, total)
Diagnostics

Diagnostics with fixes the compiler has tried

Every diagnostic has a stable GGxxxx code, labels for the definition, the move, and the later use, and a list of fixes.

  1. gg check --json returns the same diagnostic as structured data.
  2. The compiler applies each candidate fix to a copy and re-checks it.
  3. Only fixes that made the error disappear are marked verified.
See the full GG0301 output
gg check counter.gg
$ gg check counter.gg
error: `c` variable was moved (`consume`), can no longer be used.
  --> use-after-consume.gg:10:11  GG0301 use-after-consume
   |
10 |     print(c.value)
   |           ^^^^^^^
   |
 9 |     finish(c)
   |            ^ `c` is consumed here
   |
 8 |     c = Counter{ value: 1 }
   |     ^^^^^^^^^^^^^^^^^^^^^^^^ `c` is declared here
   |
 4 | fn finish(c: consume Counter):
   |              ^^^^^^^^ `finish` takes `c` as `consume`
   = help: Move a copy with `c.clone()` to keep using `c`, use it before the move, or reassign it after the move.
   = fix (verified): Remove `consume` from `c` so the caller keeps ownership
   = fix (verified): Move a copy instead: `c.clone()`
   = fix (manual): Use `c` before it is consumed, or do not use it afterwards

1 error found.
Performance

Checks stay on in release builds

18 workloads against g++ -O3 and rustc -C opt-level=3, measured on 13 October 2026. Greengold's --release keeps bounds checks and integer overflow traps on.

  • Median of five runs; peak memory, compile time, and binary size too.
  • Every program prints a checked result, so the work is not optimized away.
  • Sources for all three languages are published next to the numbers.
All 18 workloads
C++RustGreengoldshorter is faster
Mandelbrot · medianvs C++ 0.4% fastervs Rust 0.4% faster
C++319.6 ms
Rust319.6 ms
Greengold318.3 ms
Matmul · medianvs C++ within 0.4%vs Rust 1.3% faster
C++287.2 ms
Rust292.2 ms
Greengold288.3 ms
Quicksort · medianvs C++ 14% fastervs Rust 8.0% faster
C++531.3 ms
Rust495.8 ms
Greengold456.3 ms
Trees · medianvs C++ 5.1% fastervs Rust 4.0% faster
C++472.9 ms
Rust467.3 ms
Greengold448.8 ms

Status

What exists today, and what is outside the safety guarantee.

The toolchain

Version
0.21.5. Download for Windows, Linux, and macOS, or read the source on GitHub.
Compiler
Written in Python. Emits LLVM IR through llvmlite and links with clang or gcc. LLVM is the only backend.
Tools
gg check, run, build, test, fmt, doc, api, bindgen, and a language server with inlay hints.
Self-hosting
Paused. The lexer is written in Greengold; language work happens in the Python compiler for now.

Outside the guarantee

  • unsafe: blocks — pointers are not checked for liveness, alignment, or bounds.
  • trust, which skips one bounds check, in unsafe: or a hot fn.
  • The --unchecked build flag, which removes bounds checks.
  • std.thread, a pthread wrapper with no Send or Share bound.
  • Not supported: dynamic dispatch, lifetime names, storing or returning a slice []T.

The language is one document

Eighteen sections, one example per feature, and the list of forms the compiler rejects. Also available as plain Markdown for tools and models.