r/Compilers • u/FearlessFred • Oct 08 '26
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!)
26
Upvotes
13
u/kostya27 Oct 08 '26
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).
6
u/seg_lol Oct 08 '26 edited Oct 08 '26
Excellent, I know you are getting a lot of heat for using genai for writing this, but it is truly a superpower for compilers and language work.
That said, Opus 5.5 might do a better job overall, and would definitely write a README that smells less like AI.
I would suggest using the https://en.wikipedia.org/wiki/The_Computer_Language_Benchmarks_Game it would also give you the ability to compare against perfmaxxed implementations in C++ and Rust.
https://salsa.debian.org/benchmarksgame-team/benchmarksgame
2
u/EstablishmentHour335 Oct 23 '26
Hopefully you're still around because this is pretty interesting to me. From what I understand, consulting with AI because I am busy, your memory model is a series of arenas statically determined at compile time? Allocated using VirtualAlloc? Pushing to memory seems to be blind with no checks and pages are committed upon page fault exceptions (because they are not pre faulted to conserve ram)?
The one limitation I thought of when thinking about this, is that the AI claimed each growable array would have it's own "stack" (VirtualAlloc address range). If that's statically determined, then you can't have an arbitrary number of "stacks" or growable arrays. Is this true or am I misled? If true would you be planning to resolve this limitation?
In C++ I could easily do this because I am in control of the calls to VirtualAlloc, not the compiler. Actually I am a huge fan of virtual memory reserve + commit semantics, so this project is pretty interesting to me. I've been rewriting some of the C++ benchmarks using my VirtualAlloc arena allocator to beat Goose (at least on my chip), basically using your technique against you. Its interesting to see a whole language designed around this which does it automatically (at least, I think, hopefully AI isn't misleading me).
2
u/Competitive_Ideal866 Oct 08 '26
Interesting. When I tried this I found AIs were completely useless for this.
2
u/MitchAlsup Oct 09 '26
How would you build a "Defered Procedure Call" (or in Linux softIRQ) in Goose ??
4
u/Rest-That Oct 08 '26
Honestly it was extremely disappointing reading the end of your readme.
2
u/ProfessionalPlant330 Oct 08 '26
I love this, it's super interesting. Is this something you will continue to work on or is it just an experiment?
1
u/soriniros Oct 25 '26
Any plans for networking, crypto, TLS? It is awesome btw...
1
u/j_yarcat 26d ago
I'm having fun with the language. Created a small playground repo (kinda empty atm) https://github.com/yarcat/goose-playground and put a tcp echo server toy there https://github.com/yarcat/goose-playground/blob/main/echo_server.goose
1
u/Subject-Vegetable664 5d ago
How good is it speedwise for parallel/distributed/concurrent programming?
9
u/vanderZwan Oct 08 '26
So I guess nobody commenting here actually knows who Wouter van Oortmerssen is? Ok, well, ever heard of brainfuck? This is the guy wrote FALSE, the language that inspired brainfuck, back in '93, so there's a significant chance he's been designing programming languages since before most of you were born. He got a PhD in programming language design a few years later and has created countless of languages, some of them even influential. Seriously, look at what this guy has done:
https://strlen.com/
Look, I get the suspicions, I also hate what the AI industry is doing, as well as all the slopcoding that is out there, but this isn't either of that.
1
u/VictoryMotel Oct 08 '26
So you made this all by hand in the last 6 weeks?
Can you show a small example of c++ that is 3 times slower than your language?
-2
u/VictoryMotel Oct 08 '26
To recap:
My conclusion is that everything you posted is about lying and getting away with it, then having some explanation for plausible deniability - "I didn't say I didn't make it all with AI, you just have to search the right term on the right link and it's right there at the bottom of a novel!"
You could have just explained what you did up front and been honest instead of trying to deceive anyone looking at your "work" (deceiving people is called lying).
0
u/[deleted] Oct 08 '26
[deleted] — view deleted comment