5 ms·
Because they chose a half-assed way to implement generics, and the path they took doesn't interact well with the rest of the type system.
by maleldil 2y ago
Because they chose a half-assed way to implement generics, and the path they took doesn't interact well with the rest of the type system.
- jeremyjh 2y agoIs it clear they had any better choice after shipping 1.0 without generics?
- mcculley 2y agoNo. My recollection is a lot of people urging them to get generics right and into 1.0 and the Go guys saying, “don’t worry, we can add generics later”.
- yubblegum 2y agoNo, your recollection is not factual. Ross Cox laid out the case(s) and the fact that no option was manifestly preferable. Not sure what happened but after the initial resistance by the Gophers to ~1/2 of community clamoring for generics (I consider it a mistake) it seems some important Go based projects finally forced them to adopt one of the uglies (opinion, folks /g) https://research.swtch.com/generic https://research.swtch.com/generic
- pjmlp 2y agoThe same Ross Cox acknowledged that he was wrong. ". They are likely the two most difficult parts of any design for parametric polymorphism. 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...
- School-Cotton 2y ago“we were biased too much by experience with C++” (or C) could describe most of the dubious design decisions for Go. It seems there are tons of things the designers banned because they are bad in C, and didn’t supply any replacement because the C++ version is overly complicated or hard to use, and they weren’t aware of anything better. Metaprogramming is a perfect example. C macros are bad, C++ metaprogramming facilities are baroque, so let’s not have any metaprogramming features whatsoever and tell people to rely on code generations or reflection instead.
- yubblegum 2y agoThe governance of the language was borderline ideological, imo. (There is a very curious but prevalent phenomena where highly intelligent people let a governing ideology do the thinking for them and refuse to countenance ideologically discordant possibilities. (Ancient too, as we see from the ideological reaction of Pythagorean's to existence of √2..))
- dragonwriter 2y ago> There is a very curious but prevalent phenomena where highly intelligent people let a governing ideology do the thinking for them and refuse to countenance ideologically discordant possibilities. Highly intelligent people experience having correct intuition -- a product of reasoning occurring at below a conscious level -- a lot, to the point where they may learn to intrinsically trust their intuition to be correct and be highly confident it will prove correct. However, while intuition can often be a manifestation of that kind of unconscious reasoning, it can also be a product of aesthetic/ideological (really, the same thing) preference, among other biases.
- Thiez 2y agoC# has great generics and originally shipped without them, so it has been done before.
- pjmlp 2y agoNot really, C# already had generics when .NET 1.0 came out, it was decided they were not mature enough and Microsoft didn't want to delay releasing 1.0, this is the part of story most folks don't get, because they are not language geeks and dont't read about this stuff. Work started in February 1999, while .NET 1.0 was released in October 2021. https://learn.microsoft.com/en-us/archive/blogs/dsyme/netc-generics-history-some-photos-from-feb-1999 https://learn.microsoft.com/en-us/archive/blogs/dsyme/netc-g...
- jeremyjh 2y agoEven if that weren't true, GP would still be wrong to think that the problems presented by an existing language design are universal.