+23
日增长
3,569
stars
174
forks
30
watchers
184
prs
125
issues
4
releases
README
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 · Command line · 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 data stacks 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, and uses 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 structure with a million elements takes a single store, no matter how deeply it is nested. Growth preserves references. A reference into a growing array stays valid for as long as the array does. In the corresponding benchmarks, Goose keeps typed references where C++ must call reserve and safe Rust uses u32 indices. Memory safe with zero annotations. There is no lifetime syntax, there are no aliasing or exclusivity rules, and there is no unsafe. The compiler infers what every reference is rooted at 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 stored as one contiguous block that contains no pointers. A example record that takes 160 bytes and one allocation in C++ takes 29 bytes and no allocations in Goose. Variable sized Enums. Variable-mode ADTs store each value at the size of its own variant rather than that of the largest variant. On the benchmark that exercises this, they use 4x less memory than a Rust enum and run at 2x its speed. 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 a data structure can be written to a file as is. Saving it is a single write, and loading it is a single read followed by a verification pass that rejects malformed or hostile data. 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 directly into the array, and returning a growable array by value does not copy it. Returns across multiple calls. return err from load returns from a function any number of frames up the call stack. It is checked statically, and needs no unwinder, no Result
Top issues
#223Proposal: `import c "x.h"`, a C header's declarations without writing them twice7 comments · 2026-11-04#115read_file cannot read a file over 2 GB, and os cannot read in pieces7 comments · 2026-10-26#113let there be TLS7 comments · 2026-10-26#100Nested growing structs7 comments · 2026-10-26#287Windows: a fault in a trimmed slice_pool page commits a whole 1 MiB chunk4 comments · 2026-11-07#24632-bit embedded support4 comments · 2026-11-06#294Track GitHub Linguist support for Goose3 comments · 2026-11-08#221Feature request: a verified, zero-copy view over foreign bytes (e.g. an mmap)3 comments · 2026-11-03
Discussions
#327Has anyone tried writing UEFI bootloaders??0 comments · 2026-11-14#306Is self hosting a long-term goal for Goose?1 comments · 2026-11-11#302tagged templates for safe HTML1 comments · 2026-11-10#295Use a struct as a key for a dictionary1 comments · 2026-11-09#289Idiomatic Goose for a vectorized database engine (DuckDB port)1 comments · 2026-11-07#286Dark theme for docs1 comments · 2026-11-07#242Benchmark!1 comments · 2026-11-06#237Validating Goose Compiler Idea2 comments · 2026-11-06
Latest release
Goose v2026.4 v2026.4 2026-11-06Prebuilt compilers with the blessed packages (gfx, audio, ui, physics) compiled in. Unpack anywhere and put the directory on PATH; see "Install a release" in README.md for what each platform needs besides. What's Changed Dynamic externs: extern blocks bound from a shared library by name by @binji in https://github.com/aardappel/goose/pull/59 Preserve CMake archive paths in cc-style response files by @akeit0 in https://github.com/aardappel/goose/pull/56 Add an API to release unused data-stack memory by @KoudelkaB in https://github.com/aardappel/goose/pull/57 Let packagers set TinyCC's ru