[OT] Go officially won't get generics

Chris via Digitalmars-d digitalmars-d at puremagic.com
Fri May 9 04:46:18 PDT 2014


On Friday, 9 May 2014 at 07:38:46 UTC, Paulo Pinto wrote:
> On Friday, 9 May 2014 at 07:05:59 UTC, Bienlein wrote:
>>
>>> Well, he had previously stated that there would be no 
>>> breaking changes, and that if there were changes it would 
>>> have to be called "go version 2 or something". So when 
>>> generics were brought up he stated that there were no plans 
>>> for generics and "I said we are going to leave the language, 
>>> we are done" (with version 1 semantics).
>>>
>>> Ola..
>>
>> Robert Pike says in this thread 
>> (https://groups.google.com/forum/?hl=de#!topic/golang-nuts/3fOIZ1VLn1o):
>>
>> "Go has type switches, and therefore no need for the Visitor 
>> Pattern.". He has exactly the same mindset as Niklaus Wirth 
>> and Oberon never got templates. Future will tell... Would be a 
>> nice thing to bet a dime on whether Go will have generics or 
>> not. I bet not ;-).
>
> Oberon did eventually get some basic form of templates in 
> Active Oberon, but that was not under Wirth's supervision.
>
> He actually went into the other direction by making a 
> minimalist version of Oberon with Oberon-07.
>
> I had the opportunity to meet Wirth at CERN, when he and a few 
> ETHZ members took part on the Oberon Day, back in 2004.
>
> He is really great guy, but he could not understand why Oberon 
> was being ignored in the industry. As he expected the desire 
> for quality would drive developers to it.
>
> In a similar vein to Rob Pike writing the blog post why he 
> thinks C++ developers don't care for Go, Niklaus Wirth wrote a 
> long article about the industry lack of interest in minimalist 
> languages.
>
>
> The problem they fail to understand, or acknowledge, is that 
> large scale architectures in simple languages usually lead to 
> complex code with lots of boilerplate.
>
> --
> Paulo

With generics you mean templates, right? I started to use 
templates in D, although I wasn't convinced. But the more I use 
them the more I appreciate them. If you work with one or two 
basic types, templates don't seem to make much sense. But when 
you use the power of D, like having arrays of structs that hold 
arrays of structs etc., then templates start to make sense.

The thing is, the language has to be designed in a way that 
templates make sense and can be used throughout the language. If 
not, better not to introduce them. D, at a certain point in time, 
started to be designed around templates, or with templates in 
mind. I think it was Andrei who convinced Walter to do that. But 
in my view the language has to cater for templates for them to be 
useful. Introducing them randomly for the sake of having them 
will not work.


More information about the Digitalmars-d mailing list