Goose is a memory-safe systems language that eliminates the heap allocator, garbage collector and lifetime annotations typical of its category. In the repository's benchmark suite, Goose achieves higher throughput than C++ and Rust while consuming less memory, demonstrating that a streamlined runtime model can coexist with safety guarantees.

Benchmark results: speed and memory advantage

Sixteen benchmarks place Goose at 3.3 times the speed of idiomatic C++, 1.16 times hand-optimized C++ and 1.12 times the best safe Rust. Memory consumption stands at 1.9 times, 1.3 times and 1.2 times less respectively. These gains stem from Goose's data layouts and memory model, which avoid the overheads associated with traditional systems languages.

No allocator, no garbage collector, no reference counting

Goose contains no allocator, no garbage collector, no reference counting and no destructors. Memory consists of a handful of data stacks that the compiler assigns statically. Freeing a million-element structure reduces to a single store, regardless of nesting depth. This model removes entire classes of runtime overhead and potential failure points.

Growth preserves references

A reference into a growing array remains valid for as long as the array does. In C++, a vector may reallocate and invalidate existing references; safe Rust often uses u32 indices instead of typed references. Goose keeps typed references, and growth advances a pointer without moving existing elements, so references stay stable across millions of pushes.

Memory safe with zero annotations

No lifetime syntax, no aliasing or exclusivity rules and no unsafe blocks. The compiler infers what every reference is rooted in and rejects references that could outlive their owners. When a lifetime check fails, the error names the reference's root and its destination, providing clear diagnostics without developer-facing annotations.

Nested data stays inline

A string, an array of strings, a record with variable-size fields and an array of those records each form one contiguous block with no embedded pointers. A record of 160 bytes in C++ becomes 29 bytes with zero allocations in Goose. Nested data stays inline in declaration order, so a struct is a run of bytes with nothing indirect in it.

Enums that cost what they hold

Algebraic data types are the only dynamic polymorphism: no inheritance, no vtables. Every ADT can be stored in two modes. Fixed mode (Shape) reserves space for the largest payload, tag plus largest variant. Variable mode (Shape..) gives each value exactly its variant's size, so a Circle occupying 9 bytes and a Rect occupying 17 bytes coexist in the same array without padding. The benchmarked Rust enum on the same exercise occupies 4 times the space and achieves half the speed.

Links narrower than pointers

A relative reference stores a typed, checked link as a 1, 2 or 4-byte offset rather than a machine address. Structures built from them are position independent, so the data structure is already its file format: saving writes bytes, loading reads them back with a verification pass that rejects hostile bytes. A binary search tree node with key and two narrowed links occupies 12 bytes total, links included.

Everything 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. Out-parameters mostly do not appear because a function returning a grow-only array by value writes its elements straight into the caller's variable.

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. It is a hidden discriminant checked per frame rather than an unwinder, and the message is built directly where the caller wants it. The parser samples in the tutorial use this mechanism for every syntax error.

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, atomics and memory orderings do not exist in the language. A thread_fn and everything it calls is compiled as its own program with its own data stacks and its own copies of the globals. Values crossing through typed queues must be flat, with no references at any depth.

Generics and higher-order functions without overhead

An untyped parameter is generic. Function values are compile-time entities, so xs.filter() { it > 0 } compiles to the loop it looks like and builds its result straight into its destination. Everything is monomorphized; type arguments are inferred from argument types. A block may return from its lexically enclosing function, and nested functions see the enclosing function's locals.

Plain C in, plain C out

Goose compiles to one C file, so it runs wherever a C compiler does and calls C directly through extern fn. The bundled TinyCC backend compiles and runs a program in-process with no build step. This design lets Goose leverage existing C infrastructure while maintaining its own semantics.

The tutorial walks through all of these features by example, the reference covers the whole language topic by topic, the specification has the exact rules, and the benchmarks have the numbers, losses included. Goose demonstrates that a systems language can be both memory-safe and high-performance without the customary runtime overheads.