var words: u8[][>..] = [];
for i in 5 { words.push(str("word", i)); }
In C++ that is a vector<string>: one heap allocation for the vector,
one per string, a pointer and a capacity per element, and a walk over
all of them when it goes out of scope.
The example you've provided uses strings that are eligible for small string optimization, which avoids per-string allocation. All mainstream STL implementations perform this optimization. You can read about several implementations here: https://devblogs.microsoft.com/oldnewthing/20230803-00/?p=10...And these strings in Goose are 6 bytes, while the ones in C++ are apparently 16 to 24 bytes each.
Rust has had more interesting SSO types than C++ perhaps explicitly because it doesn't come with SSO out of the box although maybe also because C++ still isn't sure whether text is UTF-8 encoded even though it is 2026 now.
The obvious downside is that resizing any string but the last requires moving everything down the stack.
With objects that never need resizing, you can of course have much simpler memory layouts.
But what mistakes did the AI make about Goose? If it can say something wrong about a language it has much training data on, what's it saying wrong about a language with no training data at all? How can we trust anything it says about Goose?
Moreover, AI could have caught this mistake so even in using AI, it's clear AI wasn't used proficiently; it should have at least been tasked to proofread stuff like this.