> even Zig has methods and interfaces
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.
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.
A lot of programmers these days want static dispatch for its ergonomic value and Odin doesn't help you there. Odin thinks we should suck it up and write alligator_lay_egg_on(gator, egg, location) not gator.lay_egg_on(egg, location)
If we decide we'd prefer to type gator->lay_egg_on(egg, location) then Odin charges us for a vtable in our Alligator type, which we didn't need or want, and then we incur a stall every time we call that because we need to go via the vtable.