The Goose Programming Language
Goose is a memory-safe systems programming language that operates without a heap allocator, garbage collector, or lifetime annotations. In benchmarks, Goose outperforms C++ and Rust while using less memory. The language's syntax is familiar to C and Rust programmers. It features a unique data stack model, with every dynamic value residing inline on data stacks managed by the compiler.
Memory is freed automatically when its scope ends. The compiler infers roots for references, allowing stable references and eliminating the need for annotations. Goose's type and lifetime rules ensure safe memory usage. The language provides several features to optimize performance, such as constant-time references, stable references, and resizable data structures.
Goose does not have a single array type but rather a family of array types with varying resizing capabilities. Storing variable-size elements inline in an array results in sequential data, enabling efficient cache streaming. Algebraic data types are the primary form of dynamic polymorphism, with no inheritance or vtables. References in Goose are transparent, with no pointer dereferencing required.
The language offers a unique approach to dynamic polymorphism, featuring fixed mode and variable mode for ADTs. Goose also includes a special construct called return E from f, enabling functions to return values by reference from any call depth. The language's design ensures that constructed values are built at their final location, eliminating the need for out-parameters in many cases.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.
This story
This is one outlet's version. Read the fullest account.
- The Goose Programming Language aardappel.github.io