| ▲ | prxm 11 hours ago | |
> Zig is explicit i never got this point. whats stopping me from writing a function like this in zig?
the only thing explicit about zig approach is having ready-to-use allocator definitons in the std library. if you excluded std library and write your own allocators, you could have an even better api in rust compared to zig thanks to actual shared behaviour features (traits).
explicit allocation is a library feature, not a language feature. | ||
| ▲ | gethly 10 hours ago | parent [-] | |
the explicit part is that zig forces you to import allocator of your choosing whereas odin has allocator passed as part of hidden context and you can change/access it only if you want to. hence explicit behavior vs implicit behavior. i use neither of those languages, so don't ask me for technical details :D | ||