News for hackers. Stuff that matters.
Re:Golang generics proposal has been accepted by cies on Wednesday February 10, 2021 @03:37PM (#26094408)
Yes. But null-safety is absolute on the top (as it is soooo hard, maybe even impossible, to add later).

Generics... Well, I just come from a Elm gig (knowing Haskell/C++/Java/Kotlin/Ruby) and I must say I was not too bothered with the lack of generics there.

Re:Golang generics proposal has been accepted by jasperry on Wednesday February 10, 2021 @03:47PM (#26094543)
Wait, doesn't Elm have parametric polymorphism like other ML-family languages? That's just as powerful as most languages' generics, and with a lot fewer brackets.
Re:Golang generics proposal has been accepted by sdfsfsf3kjdf on Wednesday February 10, 2021 @03:50PM (#26094579)
> Well, I just come from a Elm gig and I must say I was not too bothered with the lack of generics there.

Elm has generics.

Re:Golang generics proposal has been accepted by cies on Wednesday February 10, 2021 @03:55PM (#26094653)
Really? Why then there's List.map, Maybe.map, Array.map, and I have to select one of them? Is that not what generics would fix?
Re:Golang generics proposal has been accepted by sdfsfsf3kjdf on Wednesday February 10, 2021 @04:01PM (#26094744)
> Is that not what generics would fix?

No. That would be fixed by having something akin to typeclasses, traits or interfaces.

Elm's List, Maybe and Array are all defined using a generic type parameter.

Re:Golang generics proposal has been accepted by shakow on Wednesday February 10, 2021 @07:10PM (#26096591)
No, it fixes that you don't have to chose between ListOfInts, ListOfStrings and ListOfListOfArrayOfInt.

BTW, one doesn't have to chose between them in Go either, but only because there are under-the-hood generics for the native types, that are only accessible to the language designers.

Re:Golang generics proposal has been accepted by floxy on Wednesday February 10, 2021 @05:46PM (#26095861)
There is a terminology issue here, with "generic" being overloaded to mean different things. Parametric polymorphism is what Go is adding. You'd like to see something like ad hoc polymorphism in Elm, like type-classes in Haskell. But neither of those should be confused with the datatype generic programming.

https://en.wikipedia.org/wiki/Parametric_polymorphism

https://en.wikipedia.org/wiki/Ad_hoc_polymorphism

https://wiki.haskell.org/Generics