All languages

Goose

Memory-safe systems language with no heap, GC, or lifetime annotations — every dynamic value lives inline on compiler-assigned data stacks; compiles to a single C file, with claims of out-running C++ and safe Rust in its own benchmark suite

Overview

Goose is a memory-safe systems language with no heap allocator, garbage collector, reference counting, or lifetime annotations, by Wouter van Oortmerssen (creator of Lobster), implemented almost entirely with AI from his human language design. Its headline idea: scope exit is the free — every dynamic value lives inline on compiler-assigned data stacks.

Code

let greet = fn(name: u8[]) {
  print("hello, ", name);
};
let shapes: Shape[>..] = [];           // grow-only data-stack array
  • fn values and ADTs define the units; match consumes an enum by tag — all inline on data stacks, freed at scope exit.
  • Case functions overload per ADT variant; .. fills struct defaults; multi-return values are consumed positionally.

Distinctive traits

  • Single memory model: native call stack + static data + N compiler-assigned data stacks; scope exit is the free — no heap, no GC, no lifetimes.
  • Safety by construction: inferred static roots reject outliving references; no aliasing rules, no unsafe; redundant bounds checks are removed.
  • ML-flavored core under C-style syntax: monomorphized generics, ADTs, position-independent T&<u32> references ("your data is already a file format" via from_bytes), compile-time function values.
  • Compiles to one plain C file — extern fn for C interop; bundled TinyCC backend runs programs in-process with no build step.
  • Author's benchmarks claim ~3.3× idiomatic C++ and ~1.1–1.3× optimized C++/safe Rust at 25–50% less memory (own suite; losses documented).
  • Trade-offs: no escaping closures, whole-program compilation only, and share-nothing threads crossing flat values through typed queues.

Status

Apache-2.0; prebuilt releases for Windows/Linux/macOS (v2026.3) with a VS Code extension and LSP. Benchmark claims are from the author's own suite — not independently verified.

Sources & references