Everyone is talking about the new Programming language called goose. It‘s biggest claims are a 3.51x speedup against Rust and C++ and dynamically sized containers with stable references.
This is true — but only under very specific circumstances. Looking at the benchmarks (16 in total), the 3.51x speedup is a win against "idiomatic C++". The gains against "hand optimized" C++ and safe Rust are 1.24x and 1.13x, while there is nowhere specified what "kind" of goose was used in those benchmarks, while the term "optimized" is also not objectively defined. And Goose isn‘t even faster in all cases. For example:
- Goose loses to expert C++ and safe Rust in the LRU benchmark: 0.88× & 0.81x.
- Goose loses to safe Rust in the scene benchmark: 0.82×.
- Goose loses to safe Rust in the calculation benchmark: 0.91×.
3.51x Speedup is a very selective representation of the result.
The biggest Catch: "No heap" doesn‘t mean unlimited memory.
Goose uses statically assigned data stacks with large reserved address-space ranges and bump pointers. The official documentation says:
- Every resizable container has it‘s own data stack. (While ownership of the stack can move to another value if the old one goes out-of-scope, so maybe, so it gets reused when they live sequencially)
- Groth advances a bump pointer.
And exactly that is the catch. It is not real dynamically sized data. I mean, conceptually, it is. It can grow at runtime. Every Goose data stack reserves a few Gigabytes of virtual address space by default, and commits physical memory if needed without occupying it from the beginning, granting stable references. But, and that’s a big "but", if that virtual adress space exceeds, the program gets terminated, like an uncatchable exception.
That can destroy the purpose of dynamic data.
When the size of a container is clear at compile or construction time, an array absolutely fulfills this job in almost every case.
The reason You need dynamically sized data is this: Imagine having a game where enemies spawn and get killed. There is no limit for enemies that can exist at the same time. You don‘t know what the player does at compile time. There could be only three enemies, but also a hundred or thousands of enemies. You can‘t reserve the whole RAM for your game, of course, and you can‘t just use the memory right after your container because it may be already occupied. And scattering objects across memory is not an option either, because it destroys CPU locality and therefore also performance. So normally, you allocate new space that is bigger, copy/move all the old elements and free the old space.
But in that case, you cannot use one of goose‘s „dynamically sized“ containers. Because, if you have so much enemies it exceeds a certain memory limit, your game gets terminated (which you usually don‘t want in prod)
So, my statement: It is not apples to apples. Goose's performance advantages come from several things: No general-purpose allocator on the allocation path. No per-object destruction. Contiguous data layouts. Narrow relative references instead of full pointers. More compact variable-sized enum representations. No relocation when growing containers. These are genuine architectural advantages, but they aren't exclusive to Goose.