Comment by mholub
9 months ago
nothing really prevents you from defining global allocator in Zig
and having explicit allocator in standard library is actually a good thing, cause it's quite a common case in game development to use arena allocators which are being freed once per frame - so you don't really need to reinvent your data structures in Zig
I do have some concerns about Zig because it also introduces some friction for correctness sake like requiring to always use all variables, explicit casts everywhere - I want some compiler toggle to disable all of that and focus on problem but unfortunately it's not there
I am playing with Zig now and haven't really formed my opinion about game development specifically but I like it a lot so far
To be fair though that sort of friction only affects things in the small. They can be annoying but you'll never have to refactor outside the scope of the friction itself.
In practice, it's only really a problem if you're doing codegen.
Zig is flexible. If you don't like global allocators or explicitly passing allocators, you can store pointer to the allocator in your object and it will be passed implicitly.