6 ms·
my rant re: generics, I wish people would read through the documentation (FAQ) and discussion of this first. The language designers have not ruled out generics
by ominous_prime 13y ago
my rant re: generics, I wish people would read through the documentation (FAQ) and discussion of this first.
The language designers have not ruled out generics, and are fully open to providing them at some point. The issue is that they have yet to find an implementation that fits within the language design goals.
Yes, if you jump on the mailing list, and propose that they somehow "use" .NETs generics, and you actually have no idea how that would be implemented, or impact the compiler and runtime, you're not going to be greeted cordially. This happens fairly frequently, and is probably why people think the community is totally against generics.
The Go team wants generics, when they find the right way to handle them within the language. In the meantime, most heavy users seem to agree that lack of generics is better than poor generics.
- quatrevingts 13y agoI am highly skeptical that they are actively investigating ways to support generics, or that they are willing to change anything else about the language to support them better. This statement, part of the standard Go talking points, seems to be designed to persuade the unsure to give the language a chance, "and generics will be around later once we figure it out." Not likely. I think the designers know that no perfect shining implementation of generics--compatible with all of Go's existing design decisions--is going to arise deus ex machina after eluding researchers for all these years.
- ominous_prime 13y agoI would like to believe that the go team members aren't being disingenuous when they say this. There has been some talk, but it's mixed in with a lot of noise too. I don't think that anyone is expecting a PL research breakthrough to provide some generics panacea. I think this is more along the lines of how can we pragmatically introduce generics without messing up too bad. From what I've seen, I personally think some form of templating has the most promise (though I am far from qualified to actually comment on its viability).
- papsosouid 13y ago>I don't think that anyone is expecting a PL research breakthrough to provide some generics panacea That already happened. In 1976. There is simply no excuse for this disingenuous "oh but go is magic and special and can't do it the same way everyone else can" nonsense. If people want that argument to be taken seriously, then they need to start offering actual specific problems with parametric polymorphism as it would apply to go. Not just saying "we're special".
- ominous_prime 13y agoNo one is saying generics can't be implemented in go, or that go is "special". Implementing generics requires tradeoffs of some sort -- compile-time and size, runtime efficiency, or language-complexity. The creators didn't want to accept any of these compromises, at least for the initial release of go.
- papsosouid 13y agoNo, it does not require a trade off. That is exactly what I just pointed out. There is no such problem. Parametric polymorphism was solved in 1976. None of the things you mentioned are actual problems, they simply do not exist. Those are invented excuses. If Rob seriously still hasn't bothered to read CS papers from 30+ years ago, that is very unfortunate. But it does not mean the problem wasn't solved, it just means he is unaware of the solution.
- Daishiman 13y agoI'm more willing to trust Rob Pike on his assesment than a random Internet comment from someone who has neither knowledge of Go nor has read the comments on their mailing list.
- deleted 13y ago[deleted]
- 13y ago
- cma 13y agoSeems like a big trap; they will get bolted on after much of the std library is frozen without them.
- ominous_prime 13y agoWell then it would already be too late, since the std lib has been frozen since go1. As long as things are added in a backwards compatible way, there's no problem though. Plus, something of this magnitude may need to be in a theoretical go2, so they can break whatever needs to be broken.
- deleted 13y ago[deleted]
- Avshalom 13y ago> In the meantime, most heavy users seem to agree that lack of generics is better than poor generics. most heavy users are self selected.
- jlgreco 13y agoIs there a problem with that? I expect you would find that most baseball players don't find baseball boring, and most nascar drivers don't think that their sport is low-tech to a fault. Outsiders may have suggestions for improvements, they may even be outsiders because they would like to see those suggestions realized, but when is that ever not the case?
- coldtea 13y ago>The language designers have not ruled out generics, and are fully open to providing them at some point. The issue is that they have yet to find an implementation that fits within the language design goals. That's the party line. And I, for one, don't believe that. Go has been going for what, 3 years? And a couple more internally IIRC. And not only they came up with nothing with regard to generics as of now, there's also no research or initiative has been started that anybody knows of. So how exactly are they supposed to "find an implementation that fits within the language design goals"? By some kind of satori?