News for hackers. Stuff that matters.
Re:How generics are implemented in Go 1.18 by shadowgovt on Tuesday March 01, 2022 @03:29PM (#30519559)
This summary concisely captures the key thing about generics that has kept them out of Go for so long: they weren't created in a vacuum. Go's developers had the flaws in C++ and Java's approaches to draw on in their attempt to find a better approach. Many people calling for generics to have been implemented sooner were fine with those flaws in the other languages, but the Go team wanted to do better than that.
Re:How generics are implemented in Go 1.18 by pjmlp on Tuesday March 01, 2022 @03:46PM (#30519773)
Generics exist in languages since 1976, more than enough examples than focusing on C++ and Java.
Re:How generics are implemented in Go 1.18 by shadowgovt on Tuesday March 01, 2022 @06:51PM (#30521673)
good point! What could the Go team glean from those languages to improve Go's generics implementation?
Re:How generics are implemented in Go 1.18 by pjmlp on Wednesday March 02, 2022 @12:54AM (#30524228)
Lots of things, here is their acknowledgement that it was a mistake to ignore them.

> we were biased too much by experience with C++ without concepts and Java generics.

https://go.googlesource.com/proposal/+/master/design/go2draf...

Re:How generics are implemented in Go 1.18 by kaba0 on Tuesday March 01, 2022 @03:55PM (#30519879)
If they wanted to avoid problems they would have implemented the feature right away, instead of making it a second thought for a supposedly modern language.