logoalt Hacker News

boomlindetoday at 4:33 PM1 replyview on HN

> But a lot of real world software just isn't that simple.

Zig doesn't force or even tends to prefer one way or another. If I want unassuming heap allocations that can be reclaimed in any order, there's an allocator for that. If I want an arena to discard at the end of something like a request or a video frame, there's an allocator for that. If I want to use a fixed backing buffer for the allocations, there's an allocator for that.

The point is that the standard library doesn't assume one or the other, which seems good if the problem is that "real world software just isn't that simple" in the more general sense that there's no one-size-fits-all allocation strategy.


Replies

NetMageSCWtoday at 7:33 PM

But for how many software domains are allocators more specialized than a single built-in general purpose one so important it should be the focus of your language?