4 ms·
This bit doesn't make sense to me: > Early in the rollout of Go I was told by someone that he could not imagine working in a language without generic types. As
by karmakaze 4y ago
This bit doesn't make sense to me:
> Early in the rollout of Go I was told by someone that he could not imagine working in a language without generic types. As I have reported elsewhere, I found that an odd remark.
> But more important, what it says is that types are the way to lift that burden. Types. Not polymorphic functions or language primitives or helpers of other kinds, but types.
Go always had generics: slice, map, channel. Writing without those I also could not imagine working in.
And if anyone's curious how instead of making Go, C++ could be refactored into a smaller cleaner language, see "Can C++ be 10x Simpler and Safer?"[0]. It even allows for a memory arena that's managed by gc.
[0] https://news.ycombinator.com/item?id=33573456 https://news.ycombinator.com/item?id=33573456
- valenterry 4y ago> Go always had generics That's not what people understand when you say a language "has" generics though.
- thomascgalvin 4y agoSure, when a random programmer on the street says a language "has generics," we mean "generics that I can use to extend my data model," or something similar. But in this talk, we have one of the creators of the language saying "you don't actually need generics," when what he meant was "you only need the generics I gave you." Go has, from the very beginning, acknowledged the importance of generics, and offered them to users of the language. But, until fairly recently, Go didn't trust users to use generics in any but a few specific cases.
- karmakaze 4y agoThe example in the article was about having arrays of ints and the like.