Remix.run Logo
stingraycharles 2 hours ago

Am I the only one who’s absolutely shocked that Go finally is embracing generics?

Does anyone have a bit of an inside view into what changed in the perspectives of the language maintainers?

I’m not buying the “it took us 20 years to understand how to do it correctly” argument, as this is something you explicitly take into consideration when designing the language or not. And it was specifically not a part of language design, and is much harder to retrofit (backwards compatibility).

So what changed?

bradfitz 2 hours ago | parent | next [-]

(I was on the Go team for ages)

Seriously, that's all it was. Just Ian alone proposed and rejected a half dozen of his own different approaches to generics. Finally a language + implementation plan came together that people all liked.

Nobody was ever opposed to generics that I saw.

abtinf 17 minutes ago | parent | prev | next [-]

Unfortunately nothing changed. They wanted generics all along.

The Go ecosystem was a delicate, special thing. It was a wholesale rejection of the malignant consultancy takeover of programming that had festered and spread for the previous 15 years. Introducing generics was a grievous error, and they just keep making it worse.

It used to be you could look at any Go code from any author and pretty much instantly understand it completely. That’s no longer the case.

It used to be you would work on a problem, just writing the code from top to bottom. No time wasted fiddling with abstractions you’ll never use. You’d grumble about it, but succumbing to the temptation was impossible. That’s no longer the case.

amtamt an hour ago | parent | prev | next [-]

If bug free binary search implementation can take 16 years, I am ready to buy generics implementation could take 20 years.

> In his landmark book The Art of Computer Programming, legendary computer scientist Donald Knuth noted that although the first binary search algorithm was published by John Mauchly in 1946, the first bug-free version was not published until 1962—taking a staggering 16 years to get right.

ckcheng 35 minutes ago | parent [-]

Took a few more years to get really bug free.

> Fast forward to 2006. I was shocked to learn that the binary search program that Bentley proved correct and subsequently tested in Chapter 5 of Programming Pearls contains a bug. ... Lest you think I'm picking on Bentley, let me tell you how I discovered the bug: The version of binary search that I wrote for the JDK contained the same bug. It was reported to Sun recently when it broke someone's program, after lying in wait for nine years or so.

https://research.google/blog/extra-extra-read-all-about-it-n...

throw2ih020 2 hours ago | parent | prev | next [-]

> what changed in the perspectives of the language maintainers?

The original maintainers moved on to other projects and the new community maintainers came to a consensus through the proposal and governance process.

bradfitz 2 hours ago | parent [-]

No, that's not accurate. The same core people were involved.

fooster an hour ago | parent | prev | next [-]

It’s also not true that because it wasn’t part of the initial design that it was harder to retrofit. I just don’t understand all this go bashing that happens on this site especially when so much is badly informed speculation. I guess it’s easier to tear something down.

whateveracct 44 minutes ago | parent | prev [-]

and they're still worse than the 1970s state of the art lol