aardappel /goose

The Goose Programming Language

★ 3,569⑂ 174👁 30⑃ 184● 125▤ 4
C++Apache-2.0Created 2026-08-30
下载:Goose v2026.4Goose-2026.4 ↓2026.42026-11-06
+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

Discussions

Latest release

Goose v2026.4 v2026.4 2026-11-06
Prebuilt 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

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON