logoalt Hacker News

b33j0rtoday at 6:55 AM1 replyview on HN

I am a low-level zig guy right now too. I have been around for a long time, and it’s funny to see arenas come back into vogue as a solution to nearly everything.

Arenas are great for avoiding allocations per tick/request/frame/layer. No symmetric free() to bracket lifetimes! They have a purpose, and we always knew that.

But by definition, your program is over-allocating as a tradeoff. Makes a ton of sense in certain use cases. However, we didn’t invent garbage collection and borrow-checking and realloc() just to publish papers ;)

Half of my time programming zig is spent considering allocation strategies. That’s a feature. “Where are the bytes?”


Replies

d3ckardtoday at 12:31 PM

We invented those strategies when we had way less RAM. Vast majority of programs could be entirely allocated upfront those days.

show 1 reply