4 ms·
The Go designers were never against generics. They just didn’t want to rush a design in without careful consideration. The real complaint should probably be “t
by hnlmorg 2y ago
The Go designers were never against generics. They just didn’t want to rush a design in without careful consideration.
The real complaint should probably be “they took too long to decide”.
- neonsunset 2y agoThere was nothing to "rush". Generics, by the time the first version of Go rolled in, were a well understood field with proven strategies of inference and lowering. Not by Go designers, I suppose.
- foldr 2y agoIn theory. The non-ideal state of Java and (especially) C++ generics suggested that it might be unwise to rush into a particular set of implementation choices.
- unscaled 2y agoThe non-ideal state of generics in Java mostly stems from having to maintain compatibility with early versions of Java that did not have generics. If James Gosling had "rushed" and copied generics Verbatim from CLU or Ada, Java would have had a very decent generic implementation. Not necessarily a perfect one, but it wouldn't suffer from the serious issues that C++ and Java suffer from (and more or less ONLY C++ and Java suffer from).
- neonsunset 2y agoIn practice. But I think this response showcases a particular trend within Go the language and its community: arrogance and insufficient acknowledgement of the outside world. There's myriad languages beyond Java and C++ both of which have rather non-standard "generics" implementation (object erasure and code templating). But, adhering to this trend, it seems Go design decided not to absorb much from the prior art. I know, surely designers of a popular language should know better? That's what conventional wisdom would suggest, and yet here we are. But hey, I should cheer on - the bolted on approach that will plague Go for the years to come might just help companies realize sooner that Go is frequently a poor choice.
- foldr 2y agoMeh, I couldn't give a stuff about the personality traits of the Go designers. I like the language, which I think is both better and worse for not having followed every modern trend in PL design. I don't know the designers personally. If they are arrogant, so be it.
- hnlmorg 2y agoEvery programming language is frequently a poor choice for somethings and frequently a good choice for others. As someone who’s been writing software for 30 years and in well over a dozen different programming languages, I can tell you that there’s no such thing as a language that doesn’t have any problems. And that’s without even touching on programmers personal preferences.
- hnlmorg 2y agoThat doesn’t mean that zero research is needed to define the best syntax and implementation approach for, specifically, Go. It just means it should have taken less time to decide on that. Which comes back to my original point: Cox was never against generics despite the popular meme claiming he was. People’s real complaint should be the time it took to decide upon an official approach. I get why some people are frustrated. But at the end of the day, most of the people who comment about it on HN aren’t people who do any development in Go to begin with. So it often just feels like people taking potshots to troll rather than an honest conversation about the merits of the article (eg in this instance, it has nothing to do with generics).
- pjmlp 2y agoNot they were, they even acknowledge not having done the work properly in regards to researching existing implementations. " In retrospect, we were biased too much by experience with C++ without concepts and Java generics. We would have been well-served to spend more time with CLU and C++ concepts earlier." -- https://go.googlesource.com/proposal/+/master/design/go2draft-generics-overview.md https://go.googlesource.com/proposal/+/master/design/go2draf...
- hnlmorg 2y agoThat statement doesn’t disagree with my comment. There are also plenty of comments online from Cox saying he isn’t against implementing generics, they just want time to do it properly.
- pjmlp 2y ago"Do it properly" is an educated way in office politics to hand wave issues. There are enough discussions on go-nuts on the contrary, plus it isn't as if there wasn't enough examples to choose from, between 1976 and 2009.
- hnlmorg 2y agoNot always. And the fact that Go now has generics should be evidence enough that Cox was always open to the idea of generics even if he didn’t feel rushed into implementing it.
- pjmlp 2y agoCox is not the founding team, and Rob Pike has publicly expressed he is not happy with the generics decision, but it wasn't his decision to take. "Sydney Golang Meetup - Rob Pike - Go 2 Draft Specifications" https://youtu.be/RIvL2ONhFBI?t=1018 https://youtu.be/RIvL2ONhFBI?t=1018 (starts here) https://youtu.be/RIvL2ONhFBI?t=1892 https://youtu.be/RIvL2ONhFBI?t=1892 (he expresses his opinion here)
- 2y ago