7 ms·
If this was true, why did they add generics?
by 0x696C6961 1mo ago
If this was true, why did they add generics?
- pjmlp 1mo agoThe generics that they eventually added, because of programming language market pressure, Kubernetes had an whole code generation gizmo to work around it, are a clunky implementation versus what could have been done if done from the get go.
- 0x696C6961 1mo agoThe generics implementation is perfectly fine. The fact that you completely dodged my question is telling. But please, keep living in your alternate reality.
- pjmlp 1mo agoI did not dodge the question at all, you just didn't like the answer. "Market pressure for language adoption". Just like all the features they keep adding where they said that Go doesn't need them in first place, turns out those features exist in other programming languages for a reason.
- 0x696C6961 1mo agoThis idea that they just caved and added them due to pressure is a false narrative invented by detractors like yourself. Here is a timeline if you're interested: 2009 Go released. June 2010 https://github.com/golang/proposal/blob/master/design/15292/2010-06-type-functions.md https://github.com/golang/proposal/blob/master/design/15292/... Jan 2011 https://github.com/golang/proposal/blob/master/design/15292-generics.md https://github.com/golang/proposal/blob/master/design/15292-... March 2011 https://github.com/golang/proposal/blob/master/design/15292/2011-03-gen.md https://github.com/golang/proposal/blob/master/design/15292/... Oct 2013 https://github.com/golang/proposal/blob/master/design/15292/2013-10-gen.md https://github.com/golang/proposal/blob/master/design/15292/... Dec 2013 https://github.com/golang/proposal/blob/master/design/15292/2013-12-type-params.md https://github.com/golang/proposal/blob/master/design/15292/... April 2016 https://github.com/golang/go/issues/15292 https://github.com/golang/go/issues/15292 Aug 2018 https://github.com/golang/proposal/blob/master/design/go2draft-generics-overview.md https://github.com/golang/proposal/blob/master/design/go2dra... Aug 2018 https://github.com/golang/proposal/blob/master/design/go2draft-contracts.md https://github.com/golang/proposal/blob/master/design/go2dra... June 2020 https://go.dev/blog/generics-next-step https://go.dev/blog/generics-next-step Jan 2021 https://github.com/golang/go/issues/43651 https://github.com/golang/go/issues/43651 Jan 2021 https://github.com/golang/proposal/blob/master/design/43651-type-parameters.md https://github.com/golang/proposal/blob/master/design/43651-... Feb 2021 Proposal accepted. March 2022 Ships in Go 1.18. You could criticize Go for moving too slow. But I'm pretty happy with the way they landed. They definitely don't feel bolted-on.
- pjmlp 1mo agoAh the usual barrage of links from Go folks, luckily we have also come prepared. > In three years of Go surveys, lack of generics has always been listed as one of the top three problems to fix in the language. https://blog.golang.org/why-generics https://blog.golang.org/why-generics > 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://github.com/golang/proposal/blob/master/design/go2draft-generics-overview.md https://github.com/golang/proposal/blob/master/design/go2dra... And naturally Rob Pike's pearl, > think the transition to getting polymorphism into the language through generics is has still got some years to work through there's still things that don't quite work right https://youtu.be/yE5Tpp2BSGw?t=2134 https://youtu.be/yE5Tpp2BSGw?t=2134
- 0x696C6961 29d agoIf they didn't want to add generics, why were they actively working on generics proposals and designs since the inception of the language? Was it a hedge against the potential of being pressured into adding them in the future?
- pjmlp 29d agoGo survey results....
- 0x696C6961 29d agoThe survey started in 2016. But even if it didn't, that still wouldn't make a difference. You're clearly not a serious person, so I think I'm done responding.
- pjmlp 29d agoMarket pressure does wonders. Seriousness is a hard topic among Gophers, what today does not matter, is apparently quite relevant tomorrow, and generics aren't the only example where this kind of pivots take place. So whatever.