Zig Interface Revisited
Achieving polymorphism via dynamic dispatch in Zig
Unlike many languages that offer interface or virtual constructs,
Zig has no built-in notion of interfaces. This reflects Zig’s commitment
to simplicity and performance. That doesn’t mean polymorphism is off the table.
In fact Zig has the tools to build interface-like behavior, making dynamic dispatch possible.
Polymorphism in Zig: The Options
Let’s backtrack a bit. There are ways to achieve polymorphism in Zig, depending on the use case:
Generi...
Read more at williamw520.github.io