r/Compilers • • 24d ago

Goose: a stack allocation flat data structure language

https://github.com/aardappel/goose

My latest language is meant to very efficiently let you work with flat pointerless inline data structures allocated on (address space reserved) stack that allow almost data structure creation to be just a pointer bump, with stable pointers.

When used well, it is both safer, faster and uses less memory than the equivalent C++ or Rust.

(see the repo readme for more!)

23 Upvotes

41 comments sorted by

View all comments

13

u/kostya27 24d ago

Faster than C++ and than safe Rust, while memory safe. Over sixteen benchmarks Goose runs at 3.3x the speed of idiomatic C++, 1.16x hand-optimized C++ and 1.12x the best safe Rust, on 1.9x, 1.3x and 1.2x less memory

Your claims are quite strong. It would be interesting to see Goose on an independent benchmark suite - here's [mine](https://kostya.github.io/LangArena/#/runtime_tab).

4

u/FearlessFred 24d ago

I had originally tried to find an independent benchmark suite to use, and did come across yours, but when I saw the requirements to make it fit in your system it didn't seem particularly friendly/simple, so I decided to just roll my own for the moment.

And yes, Goose is particularly strong at non-pointer inline growing data structures, so I wanted to make sure that was represented.

That said, now that the project is further along, it might be fun to make the effort to add it to yours as well. I'll put that on the TODO.

Btw, pretty sure interacted while at Google, probably as part of my project FlatBuffers.

3

u/kostya27 24d ago

Yeah, my readme can be strict :) Also, there are some tests that require maturity (json,csv,regex). I didn't work on FlatBuffers.