Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I find Zig's approach to generics to be very cool. Types are a first class citizen, so you basically get generics out of the box. Combined with Zig's `comptime` makes for writing very cool code. This solves lot of things you'd need macros in other languages to do.


this exactly, the language doesn't know about generics but having first class types + comptime allows you to do generics. Writing C feels like a chore now.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: