| ▲ | gethly 13 hours ago | |||||||
For allocation, Zig and Odin. Zig is explicit and Odin is implicit. | ||||||||
| ▲ | prxm 11 hours ago | parent | next [-] | |||||||
> 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. | ||||||||
| ||||||||
| ▲ | thegeekpirate 5 hours ago | parent | prev [-] | |||||||
You can require allocations in Odin to be explicit using `#+vet explicit-allocators` | ||||||||