aardappel / goose
git clone https://github.com/aardappel/goose.git
v2026.3 · 2d ago
The Goose Programming Language
+189
stars, 24h · #199
+~1.4k
stars, 7 days · #157
+~5.8k
stars, 30 days · #148
1.2k
★ total · +1358% this week
46
forks · 11 open issues
Star history (as recorded here)
LanguageC++
LicenseApache-2.0
Created2026-08-30 (1mo ago)
Last pushtoday
Watchers11
OwnerUser
Links
- GitHub: github.com/aardappel/goose
- Releases · Issues · Hacker News mentions
README excerpt
# The Goose Programming Language A memory-safe systems language with no heap allocator, garbage collector, or lifetime annotations. In this repository's benchmarks, Goose runs faster than C++ and Rust while using less memory. Tutorial · Reference · Specification · Packages · Samples · Benchmarks · Standard library Goose has syntax familiar to C and Rust programmers, but **there is no heap**. Every dynamic value lives inline on a data stack managed by the compiler. Growth advances a pointer, and memory is freed when its scope ends. The language's type and lifetime rules make this memory model safe to use. ## Why Goose * **Faster than C++ and than safe Rust, while memory safe.** Over sixteen benchmarks Goose runs at 3.3x the speed of idiomatic C++, 1.16x hand-optimized C++ and 1.12x the best safe Rust, on 1.9x, 1.3x and 1.2x less memory (results). These gains come from Goose's data layouts and memory model. * **No allocator, no GC, no reference counting, no destructors.** Memory is a handful of data stacks that the compiler assigns statically. Freeing a million-element structure is one store, however deeply it nests. * **Growth preserves references.** A reference into a growing array stays valid for as long as the array does. You keep typed references where C++ must `reserve` and safe Rust uses `u32` indices in the corresponding benchmarks. * **Memory safe with zero annotations.** No lifetime syntax, no aliasing or exclusivity rules, no `unsafe`. The compiler infers what every reference is rooted in and rejects references that could outlive their owners. * **Nested data stays inline.** A string, an array of strings, a record with variable-size fields and an array of those records are each one contiguous block with no pointer in it. A record that is 160 bytes and an allocation in C++ is 29 bytes and none in Goose. * **Enums that cost what they hold.** Variable-mode ADTs give each value its own variant's size rather than the largest one's: 4x less memory and 2x the speed of a Rust `enum` on the benchmark that exercises it. * **Links narrower than pointers.** A relative reference stores a typed, checked link as a 1, 2 or 4-byte offset. Structures built from them are position independent, so your data structure is already its file format: saving is a write, loading is a read plus a verification pass that rejects hostile bytes. * **Everything is built in place, guaranteed.** A value is constructed at its final destination through any depth of calls. `items.push(parse(line))` writes the parsed record straight into the array, and returning a growable array by value costs nothing. * **Returns across multiple calls.** `return err from load` returns from a function any number of frames up, statically checked, with no unwinder, no `Result` type and no `?` on every call. * **Threads that share nothing.** A worker is compiled as a separate program with its own memory, and flat values cross typed queues as a `memcpy`. Data races, locks,