Goose is a systems programming language built around a memory model without a heap allocator, garbage collector, reference counting, or lifetime annotations. Dynamic values live inline on compiler-managed data stacks; growth advances a pointer without moving existing data, and storage is reclaimed at scope exit with a single pointer update. The compiler tracks what each reference points into and rejects references that could outlive their owner. This design aims to combine memory safety with predictable performance, while avoiding the ownership annotations and aliasing restrictions used by other languages.
The language emphasizes compact, contiguous data layouts: nested variable-sized records can be stored inline, and enums can use either fixed-size storage or storage sized to each variant. Narrow relative links support position-independent structures that can be serialized and verified when loaded. Values are built directly in their final locations, errors can return across multiple calls, and threads communicate through typed queues without shared memory. Goose compiles to C and can call C functions. Its benchmark suite reports that it outperforms idiomatic C++, hand-optimized C++, and safe Rust across sixteen tests while using less memory; those comparisons are central to its performance case. The design also has trade-offs: variable-sized arrays are sequential rather than directly indexable, and the language’s specialized memory model constrains how data is organized.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.