Hacker News new | ask | show | jobs
by YuukiRey 498 days ago
The duck typing argument is absolutely not based on minimal or missing documentation. There wouldn't be countless issues about it in the Zig repository if it were that simple. See https://github.com/ziglang/zig/issues/17198

I'm simply going to quote one of the comments from the linked GitHub issue:

> generic code is hard. Hard to implement correctly, hard to test, hard to use, hard to reason about. But, for better or worse, Zig has generics. That is something that cannot be ignored. The presence of generic capabilities means that generic code will be written; most of the std relies on generic code.

1 comments

I disagree with that GitHub comment.

Saying Zig has generics because it has comptime is like saying c has generics, because C has a pre-processor

It's a wild take that you have to willfully ignore the context and nuance (implemention, rules, and semantics) for it to be true. More true than misleading, at any rate.