7 ms·
A good call, and probably the most reasonable decision in their situation. OTOH this removes much of the point to use generics, and makes working with stdlib f
by nine_k 5y ago
A good call, and probably the most reasonable decision in their situation.
OTOH this removes much of the point to use generics, and makes working with stdlib from type-parametric code more painful.
Still great to see things improving. It took mere 11 years.
- throw_m239339 5y ago> Still great to see things improving. It took mere 11 years. Took that much time because of little clique of people outside the go team had way too much influence in the Go community. Let see if they dump the language like they threatened to, as the result of adding generics. Of course they won't. Generics are there if one wants to, and they aren't like Java, but ADA. ADA got a lot of things right decades ago including the way tasks work from which Go routines should have taken a bit more inspiration . Congrats to the Go time anyhow.
- stevekemp 5y agoI suspect a lot of people outside the go-team made comments, suggestions, and proposals. But honestly, thinking back damn few of them resulted in changes to the language. If you'll recall back in the day there were several different vendoring approaches, but ultimately the go-team proposed and implemented their preferred solution. Similarly there have been a million generics & error-handling suggestions but none of them were introduced. It's basically lots of distracting discussions, and it doesn't feel so much like a community project that is actually seeking outside discussion and ideas. (No shame in that, but the pretense is disappointing). Personally I'm waiting for the fuzzing-support to land in 1.18. Fuzz testing is basically magical, and amazing in reporting problems even in code with "high coverage". The generics might be nice, but off-hand I don't see that I'll be needing them in the immediate future in any of my personal projects - but I fuzz-test the hell out of a lot of my projects (which largely revolve around interpreters and compilers).
- ithkuil 5y agoThose community efforts may have not been have adopted, but that doesn't mean their existence hasn't informed the Go team's solution
- gnfargbl 5y agoI actually think this is one of the reasons I like go so much, and now write code in it almost exclusively -- it isn't really a community project, but rather a labour of love from a small number of genuine experts. If it actually were a community project, I think we would have more of the "x := make(someType) vs. x := someType{}" TMTOWTDI that you find in other mature languages, and go would be weaker for it.
- frosted-flakes 5y agoTMTOWTDI = there's more than one way to do it
- cerved 5y agoGo doesn't/didn't have generics? Why?
- jikbd 5y agoBecause features in software don’t exist until someone adds them.
- chrsig 5y agothis is a really underrated comment. there's always a lot of entitlement when it comes to software. why doesn't x have y? ...because x doesn't have y yet....this stuff doesn't build itself, and it certainly doesn't get built overnight.
- Redoubts 5y agoIt’s pretty overrated really (even if grey). Mature projects and PMs treat submitted code as liabilities to be maintained, not free benefits. And every project is at the whims of its maintainer, who can absolutely reject any contribution they wish. To suggest generics weren’t here sooner because no one wanted to make the pull request it is just dumb.
- chrsig 5y agoif someone's off on some tangent implementing a major feature without coordinating with the project maintainers and it subsequently gets rejected because it doesn't fit the constraints that they've stated for the feature...that's on them. the go project is pretty upfront with how they go about deciding what will/wont get into the project, what process to follow, etc. Posing it as "why doesn't go have generics" is bound to be reductionist, because it's too coarse of a question, and any real implementation winds up having a lot of nuance. the question winds up just sounding entitled and petulant though, so if someone can't be bothered to ask a well informed question about why go doesn't have generics yet, the best answer really is "because it hasn't been added.", tautological as it may be.
- 5y ago
- kubb 5y agoRob was opposing generics from the start. People were pointing out the need more than a decade ago, but he was firmly saying no. Now he left the team.
- deleted 5y ago[deleted]
- 1_player 5y agoHe's left the team? He seems pretty active even in this recent github thread.
- pjmlp 5y agoYes, he is no longer on the core team. https://www.reddit.com/r/golang/comments/ksx4q1/what_happened_with_rob_pike/ https://www.reddit.com/r/golang/comments/ksx4q1/what_happene...
- mseepgood 5y ago> Rob was opposing generics from the start. That's simply not true. > he was firmly saying no. I'm sure you cannot find a single instance where he firmly says no to generics. He wrote in the FAQ that Go might get generics one day and that they are continuing to think about it. Here he is arguing in favor of generics: https://www.reddit.com/r/golang/comments/jditu9/what_do_generics_allow/g9a6a74/ https://www.reddit.com/r/golang/comments/jditu9/what_do_gene... And he was the one who invited Phil Wadler to help with the generics design. From the Featherweight Go paper: "Rob Pike wrote Wadler to ask: Would you be interested in helping us get polymorphism right (and/or figuring out what “right” means) for some future version of Go?" https://arxiv.org/pdf/2005.11710.pdf https://arxiv.org/pdf/2005.11710.pdf
- nine_k 5y agoI can only repeat the top comment from the "8 years of Go" thread [1]: the team made a different set of priorities, and was hugely successful in implemneting them, which also brought a ton of popularity. Golang is not my cup of tea, but I very much see the large and underserved niche it filled. [1]: https://news.ycombinator.com/item?id=15671676 https://news.ycombinator.com/item?id=15671676
- tonetheman 5y agoIt took that long because you do not NEED generics.
- colejohnson66 5y agoWell, no language ever needs features. We could all write software in C or even assembly, but we don’t because abstractions are nice. Generics are an abstraction. Take C# for example. The `System.Collections.Generic` namespace is full of generic collections (surprise!) that allow more type safe code. If I have a `List`, I can’t guarantee there isn’t something I don’t want in there (that could cause a runtime exception I don’t catch). But if I have a `List<IFeature>`, I know that everything in the list implements `IFeature` (barring compiler bugs and unsafe code).
- grey-area 5y agoAbstractions are not always nice. One of the nice things about go is it doesn’t have many abstractions and most of them are carefully thought out. I don’t want to have to inhabit somebody else’s abstractions all day at work, I want the language to get out of the way, which go does quite well IMO.
- closeparen 5y agoWhen I don’t like how something was done in a Go codebase, I’m generally SOL, since it was repeated so many times that there aren’t enough hours in the day to change them all. When extremely motivated, I’ll script manipulation of the AST, but that’s a pretty extreme thing to have to do.
- candiodari 5y agoAbstractions add a great deal of "default", potentially very complex, behaviour. This is great when starting a greenfield application. Even in extreme cases like RoR they work and quickly get a whole lot of things running. Fantastic. My newfangled thingamabob does something! And then the application grew and you have the guys who have to watch and keep the application online when it's business critical. They HATE abstractions. Because 7 abstractions that are used throughout the application means there's 127 cases the developer hasn't thought through, at least ten of them a ticking time bomb. That's 128 possible cases, one of which the developer has actually thought about, 5 they have verified to be reasonable. An easy case to show what's happening is the suggestion every new developer makes. "I'll just have a thread per connection, that's easy". And yes, it's very easy to get it running. It doesn't block during dev, it handles multiple connections and generally does the job. And it's absolutely guaranteed to crash you server for 10 different reasons in production. And yet, every new developer will (and should) do it. There's just 2 camps developers in the world, who don't agree and this won't seriously change. Learn how the "other camp" thinks and you'll do better.
- verdverm 5y agoThere is a path to upgrading library functions to generics, it will come in a later release. Looked like default generic type of the empty interface for those functions. See the other issues linked from the original.