3 ms·
> So, in the keynote, Rob underlines again that there'll be no generics. Ever. No. He said there were no plans for generics, which has been the story for some
by dmunoz 12y ago
> So, in the keynote, Rob underlines again that there'll be no generics. Ever.
No. He said there were no plans for generics, which has been the story for some time. The official FAQ still states [0]:
> Generics may well be added at some point. We don't feel an urgency for them, although we understand some programmers do.
> Generics are convenient but they come at a cost in complexity in the type system and run-time. We haven't yet found a design that gives value proportionate to the complexity, although we continue to think about it. Meanwhile, Go's built-in maps and slices, plus the ability to use the empty interface to construct containers (with explicit unboxing) mean in many cases it is possible to write code that does what generics would enable, if less smoothly.
It is my understanding that what Mr. Pike means by there being no plans for generic is in relation to the sentence
> We haven't yet found a design that gives value proportionate to the complexity, although we continue to think about it.
[0] http://golang.org/doc/faq#generics http://golang.org/doc/faq#generics
- willvarfar 12y agoAt the very end of the keynote, he fields questions from the audience. Predictably, he is asked about generics (54 mins in). His reply is very clear: "There are no plans for generics. I said we're going to leave the language; we're done."
- sagichmal 12y agoBy "the language" he means Go major-version-1. There will be no generics in Go 1, that's clear. The path is wide open for Go 2, though.
- coldtea 12y ago>No. He said there were no plans for generics, which has been the story for some time. No, the official apologist story is: we will add them as soon as we find a way to avoid all tradeoffs of the 3 different approaches to generics. And when asked how are they going to find this "magic bullet" solution since noone seems to be looking for it, some Go devs wrote HN comments to say that "we are looking into them [generics]". I'm a little offended, because nobody admitted what Rob said at the conference -- and they even tried to convince us of the contrary. That was like 2-3 months ago.