Hacker News new | ask | show | jobs
by coldtea 1166 days ago
>Where did you get the information that the Go team never wanted Generics

By them acting as if they never wanting Generics, not having Generics from day zero, delaying their implementation for a decade with BS excuses, pretending they are some kind of unsurmountable problem....

They were literally pressureed into getting them in, after years of resistance, when they recognized the mess they've made

2 comments

Of course you can make up your own little head canon about their motives but it has nothing to do with reality.
Rob Pike explicitly stated that he really isn't into generics,

https://youtu.be/RIvL2ONhFBI?t=1018 (starts here)

https://youtu.be/RIvL2ONhFBI?t=1892 (he expresses his opinion here)

We haven't made our little heads out of nowhere.

I have watched this talk back then when it came out, and I just rewatched the parts you linked. Nowhere in this talk he said that he isn't into generics. He said that he is not yet satisfied with design drafts (that existed at that time), and that he would like to bring in experts. Which he did, when he asked Phil Wadler to join, which led to the current design. The talk is actually proof that he was and is open to generics. "If we can implement these and learn about it a lot of what becomes important will clarify and something will come out of it, maybe something wonderful." Again, you make up some warped interpretation in your head.
The only compatible headcanon for their thoughts on the issue is the above though. Not sure where the "reality" comes from.
And over that period, not a single person put forward a viable and fully worked-up proposal for how generics should work in Go. It's almost as if programming languages aren't developed by anonymous people complaining on the internet.
>And over that period, not a single person put forward a viable and fully worked-up proposal for how generics should work in Go.

That was the official excuse (while each and every proposal coming in was shot down, just to get.a sub par, half-thought, Generics implementation, full of sui generis and NIH details implementation.

It's not rocket science, there are 100s of languages with Generics, including languages with many orders of magnitude more than the adoption Go has.

Which proposal would you rather had been adopted instead?

It's strange to describe the current implementation has "half thought". A lot of work was done to make sure it was correct: https://arxiv.org/pdf/2005.11710.pdf It's probably one of the most carefully thought through generics implementations in a mainstream programming language.

>It's not rocket science, there are 100s of languages with Generics, including languages with many orders of magnitude more than the adoption Go has.

It's easy to add generics but not so easy to get it right (see e.g. Java's soundness issues, the total mess of C++ templates). Rust's generics also have some dark corners (e.g. https://github.com/rust-lang/rust/issues/84857).

There’s nothing stopping language maintainers implementing a feature if you really hate the slow and thoughtful journey then the language isn’t meant for your “ideal programming language”