News for hackers. Stuff that matters.
Re:Golang generics proposal has been accepted by gautamcgoel on Wednesday February 10, 2021 @03:17PM (#26094126)
Haha, touche. Your response is fair. My point was only that some people act like any successful language must have generics, which is demonstrably false IMO. I am not opposed to innovation and ergonomics (hence, my support for arbitrary precision ints), but we should carefully weigh the pros and cons of every new proposal, especially if it increases the complexity of the language and toolchain. In my opinion, the benefits of generics are outweighed by the cost of their complexity.
Re:Golang generics proposal has been accepted by cies on Wednesday February 10, 2021 @03:22PM (#26094208)
Well, we know now, contrary to what was said about generic-and-Go when Go came out: Go can apparently not do without generics.

What I always found hard to swallow is that Go's build in functions sometimes did have generics. Just you as a library/application writer were not allowed to create APIs with generics yourself.

Re:Golang generics proposal has been accepted by Cyph0n on Wednesday February 10, 2021 @03:29PM (#26094305)
Yep, seemed weird to me how (a form of) generics existed, but was exclusive to the stdlib/language.

If generics were unnecessary, why did the stdlib/language need them? Couldn't they just have lived with, e.g., make_map, make_slice, make_chan, etc?

Re:Golang generics proposal has been accepted by cies on Wednesday February 10, 2021 @03:34PM (#26094371)
Exactly. It was IMHO pretty authoritarian to say "you dont need generics" and then use it yourself in the standard lib.

But then Go is not a public place: it's private domain of Google.

I decided long time ago I dont want to learn a private tool without being paid.

Re:Golang generics proposal has been accepted by piinbinary on Wednesday February 10, 2021 @03:33PM (#26094367)
And a separate copy of `append` for every possible type :)
Re:Golang generics proposal has been accepted by CarelessExpert on Wednesday February 10, 2021 @03:21PM (#26094190)
First: I ninja-edited my comment after the fact with a thought that occurred to me after I posted, so apologies there.

Anyway, yeah, no argument there at all.

I'll be honest, as an outsider that's somewhat familiar with Pike's obsession with simplicity in Go, I'm actually a bit surprised this is getting in. It does seem like the kind of high-complexity feature that was deliberately excluded from the language as part of its overall design ethos.

But it really comes down to a weighing of pros and cons. Generics have the potential (though definitely not the guarantee!) to trade off developer complexity for compiler and toolchain complexity, and the preference on that choice is a personal one.

Re:Golang generics proposal has been accepted by loopz on Wednesday February 10, 2021 @03:34PM (#26094376)
Well, then you also know he just didn't see any good implementations of generics, yet. Let's hope this gets good!