Remix.run Logo
lenkite 2 days ago

Zig will be forced to introduce interfaces or traits or whatever they want to call it just like Go was forced dragged, kicking and screaming to introduce generics.

Nobody is going to want to live without proper interfaces or an equivalent in 202x instead of DIY hacks. Its a fundamental, building-block of software development. You will have a gazillion complaining in Zig forums after its 1.0 release.

nasretdinov 2 days ago | parent [-]

The analogy with Go is quite interesting, because in the end, after Go got its generics, the actual usage of this feature is quite minimal compared to what I expected :)

lenkite 2 days ago | parent [-]

That's an interesting assertion but does not hold to reality. Nearly every single modern Go library leverages Generics in some manner AFAIK. It is a feature primarily meant for library authors anyways. Go generics are still limited - nowhere as powerful as Rust/C++ or even Java's generics. Primarily because they added it too late and ran into considerable trouble, instead of upfront thinking about the design.

Interfaces however are far more fundamental. Any app with components and modularization would declare intent through interfaces. Not having interfaces/traits as a language feature is like living without a hand or leg. Sure you can limp and hop, but it will get rather tiresome.