Hacker News new | ask | show | jobs
by peterevans 3032 days ago
I recall reading something from some of the language developers who had indicated that their worry with generics was whether they could do it right. I inferred that to mean, whether they could do it in a way that felt as simple as the rest of the language does.

I would guess generics, when it lands, would look syntactically similar to the way channel type declarations look; you can have "chan int", so perhaps you would have "vector int". That feels the most intuitive and Go-ish to me. Channels require special syntax to work with, but with generics, I imagine you'd want to make use of interfaces.

I can see a bunch of ways of doing it—but none I could guarantee would end up in the finished product! But I do think generics land at some point. The unfortunate thing is there's a sense going around that Go doesn't have generics because the language authors somehow know better than everyone else; if anything, I think they have an abundance of caution that some other language developers have lacked.