3 ms·
>Generics is the single biggest language feature absent in Go. It’s often missed by newcomers to Go. But it’s more of a type-system mechanism. It’s unclear if i
by coldtea 11y ago
>Generics is the single biggest language feature absent in Go. It’s often missed by newcomers to Go. But it’s more of a type-system mechanism. It’s unclear if it’s an essential language feature.
Oh, it's clear by now. Though "essential" is a weasel word -- in a way nothing is essential in the sense you can do it all with assembler too.
>Generics are incredibly complex in both semantics and implementation. There are considerable trade-offs to consider, such as do you want a larger binary vs. slower binary vs. larger source code.
Unless I use them, I get none of those downsides. And when I need them, I now have to implement support for my types manually, which results in larger source code anyway.
And "larger source code" hasn't been a problem since 1980.
>Language features without competition: goroutines, interfaces, defer (now in Swift)
Those have been around in several other languages... Hardly "without competition".
>Tools without competition: fast compiler
It's fast because it's not doing much. And there are several compilers that are fast too.
- 4ydx 11y agoYes and they made a conscious decision to not include so much in the language in order to make the compiler fast so your criticism is rather odd. They made a choice. It results in a faster compiler. And yet your comment comes across as if this is somehow unfounded praise. Nonetheless we have all come to love your "get-off-my-lawn" sort of approach to criticising golang at this point, I suppose :)
- coldtea 11y ago>Yes and they made a conscious decision to not include so much in the language in order to make the compiler fast so your criticism is rather odd. They made a choice. It results in a faster compiler. The null compiler (which produces nothing) is even faster, but 1000s of orders of magnitude. As you can see I'm not in favor of the choices they made to make the compiler fast. It's not much of a feat -- it's like writing a 8-bit era like game, and bragging that it gets 2000 fps performance. First, after 60 fps it's dimminishing returns anyway, and second, yes, but at what cost?