News for hackers. Stuff that matters.
Re:John Carmack on the Goose Language: multiple data stacks ... by daoxid on Saturday October 24, 2026 @04:50PM (#50225124)
I'm curious, when returning a dynamically sized array from a function, does the whole array need to be copied? C++/Rust would simple move the array out of the function (i.e., they would only copy the pointer to the underlying data), but it seems this wouldn't work in Goose if the stack the dynamic array lives in is cleared on return?
Re:John Carmack on the Goose Language: multiple data stacks ... by malisper on Saturday October 24, 2026 @04:59PM (#50225215)
Goose determines where the array will be copied to at compile time and allocates it there.

Rust does a similar thing. When a function returns a value, a location for it will be put in the callers stack frame. That means it automatically stack-allocates values when feasible. The downside in Rust is you need to know the size of the value at compile time whereas Goose can do it for arbitrarily sized values