News for hackers. Stuff that matters.
Re:Go 1.5 Release Notes by coldtea on Saturday August 01, 2015 @08:59AM (#9986877)
Do you find Go imposing any special set of contraints? If anything is far less featureful and Algol-like than most of the other languages that have found a way to fit Generics.
Re:Go 1.5 Release Notes by skybrian on Saturday August 01, 2015 @01:54PM (#9987937)
As far as I know it's not that something couldn't be shoehorned in, but rather that the language designers' tastes result in additional technical constraints.

Apparently they don't want to support only boxed types (like Java), and they also don't want to generate multiple implementations of each generic function for each size, resulting in code bloat (like C++), or to generate code at runtime (like, say, Julia).

You could argue that they should just make a choice and go with it because generics are so important, and some language designers would do that, but then these differences in design goals are why we have different languages in the first place.

This is based on an early article by Russ Cox [1]; I don't know how the teams' position has evolved since then.

[1] http://research.swtch.com/generic

Re:Go 1.5 Release Notes by ansible on Saturday August 01, 2015 @11:31AM (#9987373)
Go does have some things like interfaces that don't work quite like they do in other languages.

I have yet to see a full technical proposal that integrates well with the existing language features and has no nasty corner cases. If such a thing existed, I'd be among the first to stand up and applaud it.

The best solution currently (IMHO), is code generation with things like gen [1]. Though I have yet to use that in a real project, so I can't say for sure it is actually the best solution.

[1] https://clipperhouse.github.io/gen/