Zig doesn't have interfaces as a language level feature. It uses manually implemented vtables and wrapper methods.
You can do the same in Odin with wrapper functions around a vtable.
I have an important metric for new "systems" languages: does the language allow NULL for it's commonly used pointer type. Rust by default does not (References may _not_ be NULL). Here is where I think Odin makes a mistake.
In the linked blog post Odin mentions ^os.File which means pointer to File (somewhat like *FILE in C). Theoretically the pointer can be NULL. In practice, maybe I would need to check for NULL or maybe I would not (I would have to scan the Odin function's documentation to see what the contract is).
In Rust, if a function returns &File or &mut File or Box<File> etc. I know that it will never be NULL.
So Odin repeats the famous "billion-dollar mistake" (Tony Hoare). Zig in comparison is bit more fussy about NULL in pointers so it wins my vote.
Currently this is my biggest complaint about Odin. While Odin packages a lot of power programming idioms (and feels a bit higher level and erognomic than Zig) it makes the same mistake that Golang, C and others make regarding allowing NULL in the default pointer type.
MangoToupe•1h ago
BigJono•1h ago
messe•34m ago
All procedures in core/os. Odin isn't removing the allocator from implicit context in the rest of its APIs.
leecommamichael•32m ago