News for hackers. Stuff that matters.
Re:What is malloc doing, anyway? by connicpu on Monday November 09, 2026 @10:11AM (#50426740)
Avoiding the heap entirely isn't required and will prevent you from working with substantial amounts of data. The real key is to allocate all the memory you need up front and use that large block for a long duration.
Re:What is malloc doing, anyway? by packetlost on Monday November 09, 2026 @11:29AM (#50427811)
> Avoiding the heap ... will prevent you from working with substantial amounts of data

This isn't really true of Goose, but it's avoiding 'the heap' in the C sense, not in the OS allocated pages of memory sense. One is a programming abstraction provided by the other, but GP is only talking about the programming abstraction. I have never encountered a program that couldn't have memory be explicitly tied to lexical scope, but it can result in less efficient use of it in some cases.

Re:What is malloc doing, anyway? by dataflow on Monday November 09, 2026 @12:12PM (#50428413)
[delayed]
Re:What is malloc doing, anyway? by packetlost on Monday November 09, 2026 @12:57PM (#50429008)
Goose is a weird language. It uses a pile of pre-allocated datastacks, enforces lexical lifetimes for all data, and has first-class syntactic support for capped, growable, and shrinkable arrays. It also spits out a pile of C that gets all the optimization benefits of <insert C compiler of choices>.

Goose in particular excites me because I have done similar design work over the years.

Re:What is malloc doing, anyway? by senderista on Monday November 09, 2026 @01:46PM (#50429746)
I just want to point out that the author of Goose has plenty of technical cred, having authored flatbuffers and lots of other cool stuff.
Re:What is malloc doing, anyway? by dataflow on Monday November 09, 2026 @03:34PM (#50431665)
[delayed]
Re:What is malloc doing, anyway? by Someone on Monday November 09, 2026 @04:41PM (#50432644)
[delayed]
Re:What is malloc doing, anyway? by kbolino on Monday November 09, 2026 @05:00PM (#50432866)
It might be worthwhile to balance these positive claims against the language's own stated limitations [1].

Also, I took a closer look at the actual benchmark results [2]. For memory usage, at least, the median and mode would show Goose using slightly more memory than the well optimized C++ and Rust. It looks like the mean is skewed in Goose's favor by a couple of benchmarks where it does extremely well due to its variable-length enums.

[1]: https://aardappel.github.io/goose/docs/tutorial.html#18-limi...

[2]: https://aardappel.github.io/goose/bench/results.html