News for hackers. Stuff that matters.
Re:Go is Google's language, not ours by masklinn on Wednesday May 22, 2019 @07:46AM (#19980092)
> The whole point of generics is that the language makes available some form of abstraction over types. Go does not have this feature.

Go absolutely has this feature. Just not for you as a user of the language.

> It has some built-in operators that can operate on multiple types.

Go has multiple builtin functions which abstract over type parameters e.g. close() can operate on any chan, append() or copy() can operate on any slice. They are not operators (symbolic or keyword).

> Most languages have this. The arithmetic operators in C, for example, can take operands of many different types. This is not "generics".

It's overloading, +(int, int) and +(double, double) are separate functions under the same symbol. It's an orthogonal feature, so much so that there are plenty of languages which do have userland generics and don't have overloading.

> This can't really be the right explanation given that generics are now being added to the language.

The core team has been saying they're considering the feature / issue pretty much since the language was first released. You'll have to excuse me if I don't hold my breath.

Re:Go is Google's language, not ours by foldr on Wednesday May 22, 2019 @08:08AM (#19980239)
>Go absolutely has this feature. Just not for you as a user of the language.

That seems like a roundabout way of saying that it doesn't have the feature.

>It's overloading

You could just as well regard Go's close, append, copy etc. as overloaded.

> The core team has been saying they're considering the feature / issue pretty much since the language was first released. You'll have to excuse me if I don't hold my breath.

They've come out with a specific generics proposal. I'm not sure why you would think that they're not serious about implementing it.