Also I thought Zig doesn't have interfaces....how does the IO one work?
Also I thought Zig doesn't have interfaces....how does the IO one work?
Also, Zig's tagged unions (enums with payloads in Rust) are really ergonomic and often what you want instead of interfaces. Alot of languages that use interfaces simply don't expose a good way of doing it so everyone reaches for interfaces by default. But if you don't need an actual interface then this way you don't even have to pay the cost of runtime dynamic dispatch.
Oh well, people like it so I won't judge, I'm happy we have choices for what languages we use. Just wish people would choose safe ones :/
Which is basically how most device drivers in OSes that happen to be written in C, including UNIX flavours, work.
Sincerely, thanks for all your hand-written hatred.
Modula-2 like safety is still better than C will ever be, though.
Yeah, it will be human as far as I can take it, cheers.
[1]: https://github.com/c3lang/c3c (C3)
[2]: https://github.com/zenc-lang/zenc (Zen C)
The "module" system is another hack.