3 ms·
How many different proposals for generics have there been?
by azhenley 6y ago
How many different proposals for generics have there been?
- nappy-doo 6y agoI think this makes the third official attempt. I have high visibility into the process, and I think it's likely this one will stick. It'll likely take 2 releases (as Ian stated) to get it done.
- EwanToo 6y agoThere's been quite a few early proposals and drafts. This is the first one that I'm aware of that Google have agreed to implement.
- spf13 6y agoThis is the first. There have been several designs previously, each of which was refined based on feedback, culminating in this proposal.
- dgb23 6y agoI have observed it from afar and my impression is that this is a close to final step in a long series of careful iteration, discussion and research.
- throw_m239339 6y agoActually not that much, I remember 2 very different proposals, including this one. The previous one was confusing as F and the antithesis of the simplicity Go claims it abides by. It felt very much like a plot to add generics without ever using the word generics anywhere and looking too much like Java/C#/... The current proposal is basically what you'd expect from generics in a programming language, but a bit more limited. It took basically 10 years, a generation of developers, to quell the opposition against generics in Go, to end up with generics... They might even have unknowingly followed the ADA implementation except that Go's type inference makes them even easier to use. > To use a generic type, you must supply type arguments. This is called instantiation. https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md https://go.googlesource.com/proposal/+/refs/heads/master/des... This is basically how generics as packages in ADA works. I would add that ADA solved many existing problems in Go decades ago... https://en.wikibooks.org/wiki/Ada_Programming/Generics https://en.wikibooks.org/wiki/Ada_Programming/Generics > The generic procedure can be instantiated for all the needed types. Now all Go needs to do is to look at how Ada tasks work in order to fix every single issue with Go routines...
- wejick 6y agoI'm curious what's the issue with go routine and what kind of fix ADA bring?
- boyter 6y agoNot familiar with Ada but the inability to stop running goroutines from outside it is annoying and leads to a lot of state telling them to exit. Sometimes I just want it to stop now.
- wejick 6y agoIt's not like on pthread where we have a trhead handler, that will complicate many things. Like you said, We stop the go routine by telling it to exit the function, it's quite straightforward I think. Not more than a channel and switch case (+ context)
- rbranson 6y agoHow would you expect that to actually work though? If a goroutine could be arbitrarily stopped at any point, that would trivially lead to degenerate program states. A lock could be held open or another goroutine could be waiting on it for a message.
- wejick 6y agoIt's very good to witness the journey of generic, how the team is very cautious and dedicated to bring Go way of perfection. IMO This is something that can't be done by a committee of so called industry players.