Generics, please go away!

2,635 views
Skip to first unread message

Martin Hanson

unread,
Dec 20, 2020, 2:38:54 PM12/20/20
to golan...@googlegroups.com
I think people who want generics added to Go should go and program in Java or C++.

Adding generics to Go will ruin the beautiful simplicity of the language and I haven't found a single example in which adding generics to Go pays off.

Even with the examples of having two almost identical functions reverse some list, one of ints and one of strings, seriously!? We already have tons and tons of open source reusable code that covers all use cases which people complain about.

Go was designed without generics purposefully from the start and Go is fine just the way it is.

Adding generics means that we're opening the door to the beginning of bloating Go with all the crap that Java, C++ and all the other complex languages has gotten over the years, and Go was designed specifically without that clutter. So we add generics, then what? Classes?

Adding generics to Go ruins that beautiful simplicity that went into the design and the added complexity just isn't worth it! The standard library have managed just fine without generics and so have we!

Space A.

unread,
Dec 21, 2020, 7:26:02 AM12/21/20
to golang-nuts
Unfortunately it was expected that creators of the language will not resist forever being under the pressure of masses most which do not even code in Go, or not use Go as the main language and just following patterns and shitty idioms they took elsewhere. Generics are bullshit crap in its essence. They either don't improve anything or overused (with some huge cost). I'm telling this as someone who had 15+ years in Java before moved to Go. I was literally happy when I found that Go has almost everything which is good about programming and almost nothing bad. And I knew that it will start degrading at some point. I just keep some hopes that community will fork the language after this "Cyberpunk" releases. Rephrasing "no is temporary, yes is forever": good Go is temporary.




воскресенье, 20 декабря 2020 г. в 22:38:54 UTC+3, Martin Hanson:

Kevin Chadwick

unread,
Dec 21, 2020, 10:40:41 AM12/21/20
to golang-nuts
On 12/21/20 12:26 PM, Space A. wrote:
> Unfortunately it was expected that creators of the language will not resist
> forever being under the pressure of masses

Whilst I don't agree with the language of these mails.

I have worries and struggle to see much benefit also.

Mostly I feel the time could be better spent elsewhere, though I am sure that I
am missing much of the picture.

It is said that it will only be used sparingly and some stdlib functions can
then be written that will be simpler to use.

Yet in Dart I even see examples for riverpod/provider for non generic code
written using Generic syntax, for demo purposes!

The performance will also be reduced, so wouldn't there be pressure for the
stdlib to keep duplicated more performant code, in most cases?


I take comfort in the airings that unlike Dart where dynamics were the norm
originally. It will be explicitly made clear that Generics are intended to be
far from a first resort.

Md. Alim Ul Karim

unread,
Dec 21, 2020, 11:49:13 AM12/21/20
to golang-nuts
Not sure I agree with you.

Let's see others' thoughts on it.

Artur Vianna

unread,
Dec 21, 2020, 11:49:39 AM12/21/20
to Space A., golang-nuts
Although i am also against generics, as i didn't even know it existed before i started to see people complaining that Go didn't have it, i don't think it will be that bad. It probably won't be overused for the same reason interface{} isn't overused, the cases where it really makes sense and is idiomatic go are very few, and when used out of these cases, they will be pointed out by other people as bad practice.

Additionally the drafts for generics don't want to break the language, and as such you can keep writing your standard Go as it never existed.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/99ee1c1d-202c-421b-b63f-138d62e49dfcn%40googlegroups.com.

Martin Hanson

unread,
Dec 21, 2020, 11:49:42 AM12/21/20
to golan...@googlegroups.com
I have just suggested the same thing @Space A, before I read your message and I agree fully!

https://github.com/golang/go/issues/15292#issuecomment-749032046

I strongly believe we need to fork Go if generics gets added and then let the toy people have their new shiny things in Go while we rename Go into something else and stay with Go 1. Then we need to have the first and most important rule, that NOTHING new gets added to Go 1.

Go definitely needs a fork if generics gets added!

L Godioleskky

unread,
Dec 21, 2020, 12:50:17 PM12/21/20
to golang-nuts
Hopefully, the Go team will encapsulate all generics in a separate module(s), so that those of us who want to ignore them can easily do so 

Robert Engels

unread,
Dec 21, 2020, 12:57:26 PM12/21/20
to L Godioleskky, golang-nuts
A fork is a bad choice. Better to just not use them and/or prohibit them by policy in your org. A fork will die a slow painful death - this is a personal opinion only. 

On Dec 21, 2020, at 11:50 AM, L Godioleskky <lgo...@gmail.com> wrote:

Hopefully, the Go team will encapsulate all generics in a separate module(s), so that those of us who want to ignore them can easily do so 
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

Markus Heukelom

unread,
Dec 22, 2020, 4:23:33 AM12/22/20
to golang-nuts
Why not issue a poll on generics, was this ever done? (I could've missed it, I  am only following Go ~2 years). While the community has a vote in accepting/rejecting the current generics proposal, the community was never (really) asked if generics is desired in the first place and especially what the scope of generics should be. Is that correct? 

Another thought:  there are many popular, type-safe programming language with generics already. So if you really need generics, there's plenty to pick from. There's not that many  without, I can only name Go and C. So if generics is added to Go there's far less choice to pick a modern type-safe language that doesn't have generics. It's a feature that makes Go quite special.

To me, the most worrisome thing about the current generics proposal is that there'll be a constant choice/preference fight between writing

func MyFunc(r io.Reader) error {}

- or - 

func MyFunc[T io.Reader](r T) error {}

I hope I am wrong, but I have the feeling the latter looks cooler to a lot of programmers out there. 


wilk

unread,
Dec 22, 2020, 4:34:38 AM12/22/20
to golan...@googlegroups.com
It could be easy to fork Go and just forbid generics but you'll loose
all the libs that will use generics. And it's in libs that generics is
most usefull (like interfaces) !

I'm not so afraid of generics.
When i see the last draft, we can even says that we already have a form
of generics at method level with concept of interface since beginning.
When we use io.Reader, it's generic, we don't wait for a type.
The way generic are added it's not really generics like in
other langages, it's type parameters with constraints like with
interface with method. It's not really a new concept in Go.

We already can abuse of empty interface{}. It'll be the same with type
parameters, we could abuse of type 'any' but most of the time we'll use
type parameters with constraints, like interface with method and it'll
keep strong.

Sorry for my bad english, if somebody understand and could rewrite what
i mean ?

--
wilk

Martin Hanson

unread,
Dec 22, 2020, 5:09:05 AM12/22/20
to golan...@googlegroups.com
No polls. It's not a matter of majority rule!

It's a matter of understanding why generics was left out of Go from the
start, like classes was left out of Go. If we start adding stuff that
the original developers of Go left out by purpose, we're not
understanding the design choices that went into Go, which is exactly
what makes Go unique!

Go was a major slap in the face to all the hype that has polluted the
programming industry for the past 30-40 years, which is why Go got so
much hate in the beginning from all the hype loving people.

If you want to add generics to Go, if you want to change how errors are
handled, if you want X, Y or Z feature that Java, C++, or some other
complex language has got, then go use that language! Why are you even
here!?

The design choices that went into Go was not made randomly, nor were
they made by just anyone. Please understand that the people who
designed Go, and we all know who they are, had/has tons of experience
and the pragmatic approach they took is what make Go stand out so
beautifully!

If generics gets added to Go, we're opening a very dangerous door, and
it will be the downfall of Go because - and Robert Griesemer this is
especially addressed to you - what's next then? Seriously, what's next?
Let the community decide by majority!? Is that how we design a
professional programming language now? By majority rule?! NO! The
majority is all about hype and shine.

Adding generics to Go will rip out the spine of the philosophy of Go
and I for one will not be a part of that. I have more than 30 years of
experience in the business and I fully understand why generics and
classes and all the other clutter was left out of Go.

If generics gets added to Go, we're a big enough part of the community,
that passionately hate that, that we can manage to fork Go - which I
strongly believe will then be the right thing to do!

Axel Wagner

unread,
Dec 22, 2020, 6:01:53 AM12/22/20
to Martin Hanson, golang-nuts
On Tue, Dec 22, 2020 at 11:09 AM Martin Hanson <greenco...@yandex.com> wrote:
It's a matter of understanding why generics was left out of Go from the
start, like classes was left out of Go. If we start adding stuff that
the original developers of Go left out by purpose

That is some serious revisionism of the facts. Ian (who is spear-heading the generics effort) is one of (if not *the*) first person to join Go's development. And it has *always* been the communicated stance of the Go team (including the original three people who've been there before him) that generics would be nice to have, if they can figure out a way to fit them in.

I'm as skeptical about generics as the next guy. But this denial of historical fact doesn't help anybody. Neither is exclusionary language like talking about "true Gophers". Go is an inclusive project and wants everyone to feel welcome - *obviously* that includes people who want generics in the language. Please read - and keep to - the Go community Code of Conduct: https://golang.org/conduct

 
we're not understanding the design choices that went into Go, which is exactly
what makes Go unique!

Go is not a religion. Go is not something that was prophetized on stone tablets and handed down from mysterious, otherworldly gods.
It's a programming language and a software project. The people who came up with it and designed it are alive and well and they explain their decisions regularly and patiently. One of those people is Ian.

I am comparatively late to the party with adopting Go, but even I feel comfortable saying I understand the design choices that went into Go.
 
If you want to add generics to Go, if you want to change how errors are
handled, if you want X, Y or Z feature that Java, C++, or some other
complex language has got, then go use that language! Why are you even
here!?

I said so above but it benefits from repitition: If you are someone who wants the language to change, if you want generics, if you feel error handling could be improved, "if you want X, Y or Z feature that Java, C++, or some other complex language has got", you are welcome in our community. Your viewpoint is valued. Your, Martin, viewpoint that generics *shouldn't* be added to Go is valued as well.

What isn't welcome is your attempt of alienating people with a different viewpoint from yours and make them feel unwelcome. And if you continue to insist on doing that, the community *will* ask you to leave.

the people who designed Go, and we all know who they are

No offense, but I do get the impression that you actually don't.
 
If generics gets added to Go, we're opening a very dangerous door, and
it will be the downfall of Go because - and Robert Griesemer this is
especially addressed to you - what's next then?

Just to be clear: On the one hand, you are trying to make an argument that the original designers of Go are impossible to understand, their competency transcends reason and they should be trusted to come up with the best design for a language. And on the other hand, you are trying to explain one of those original designers, who is currently working on adding generics, that what they are doing is "the downfall of Go"? Think about it. That should really cause you some cognitive dissonance.
 
If generics gets added to Go, we're a big enough part of the community,
that passionately hate that, that we can manage to fork Go - which I
strongly believe will then be the right thing to do!

I can say, I would genuinely be happy if a fork of Go without generics will be made and if people who feel they can't live with a language containing them migrate to that fork. Just as I was genuinely happy about Devuan being created by people who feel they can't live with an operating system using systemd. The Debian project became better by that fork existing and I suspect, the Go project would be better with such a fork.

Because it would give relentlessly negative people a place to be in peace, somewhere else.
 

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

Jan Mercl

unread,
Dec 22, 2020, 6:47:32 AM12/22/20
to Axel Wagner, Martin Hanson, golang-nuts
On Tue, Dec 22, 2020 at 12:01 PM 'Axel Wagner' via golang-nuts
<golan...@googlegroups.com> wrote:

> Go is an inclusive project and wants everyone to feel welcome - *obviously* that includes people who want generics in the language. Please read - and keep to - the Go community Code of Conduct: https://golang.org/conduct

I have never read the CoC, but I don't expect it justifies implanting
irrelevant social issues into a technical discussion like this to be
used as an argument against a differing opinion. Please don't, thank
you.

Back to the topic. Yes, I agree that Go is going through a serious
case of featuritis for some time. It's sad, but knowing there's
nothing I can do about it, I'm not really frustrated. Afterall there
are places where generics will be just fine. I will be frustrated,
however, when I'll have to read generic code in places where it
shouldn't be generic. Grep would no longer point me to a particular,
plain readable implementation, which then would have to be built
mentally only and that will be much more complicated to do.

That will happen. It happens routinely in every other programming
language that has generics. Because for so many it's so cool to write
write-only code.

I'm sometimes a sinner too.

Axel Wagner

unread,
Dec 22, 2020, 7:03:11 AM12/22/20
to Jan Mercl, Martin Hanson, golang-nuts
On Tue, Dec 22, 2020 at 12:46 PM Jan Mercl <0xj...@gmail.com> wrote:
On Tue, Dec 22, 2020 at 12:01 PM 'Axel Wagner' via golang-nuts
<golan...@googlegroups.com> wrote:

> Go is an inclusive project and wants everyone to feel welcome - *obviously* that includes people who want generics in the language. Please read - and keep to - the Go community Code of Conduct: https://golang.org/conduct

I have never read the CoC, but I don't expect it justifies implanting
irrelevant social issues into a technical discussion like this to be
used as an argument against a differing opinion. Please don't, thank
you.

You might want to give it a read, then. It includes "Be friendly and welcoming" as the first Gopher value. Saying "I think people who want generics added to Go should go and program in Java or C++" and asking "Why are you even here!?" is clearly the opposite of welcoming.

And, FTR, saying something is "a technical discussion" doesn't make it so. This thread is almost exclusively about *social* issues - the arguments brought forth are mostly talking about how decisions are made, baseless claims that generics are added solely by majority decision or polls, fear-mongering about slippery slopes, appeals to authority and trying to create an us-vs-them and "threatening" to split the community. There is very little technical content here.

I feel well justified in calling this out as destructive behavior.

Space A.

unread,
Dec 22, 2020, 7:21:46 AM12/22/20
to golang-nuts
Your message is perfect example of why most of the ppl who have their own different opinion and who have never been listened to or given that ability will just shut up, and stay away.

вторник, 22 декабря 2020 г. в 14:01:53 UTC+3, axel.wa...@googlemail.com:

Jan Mercl

unread,
Dec 22, 2020, 7:23:09 AM12/22/20
to Axel Wagner, Martin Hanson, golang-nuts
On Tue, Dec 22, 2020 at 1:02 PM Axel Wagner
<axel.wa...@googlemail.com> wrote:

> I feel well justified in calling this out as destructive behavior.

You've defined the problem much better than I could ever do. But this
one is not technical and off topic in this thread. Thanks for
considering.

Axel Wagner

unread,
Dec 22, 2020, 8:07:20 AM12/22/20
to Space A., golang-nuts
You are very welcome to voice your opinion. Including the opinion that generics should not be added to Go.
What you shouldn't do - and that's all I criticized - is to tell people who disagree with you on that to go away.

I also think it's not wrong to point out that claiming the original designers of Go left out generics on purpose is, at least, distorting the documented historical facts. Or to point out the contradiction in saying, on the on hand, that we should listen to the original designers about what does and does not belong into the design of Go and, on the other hand, telling one of those exact designers that they are ruining the language.

I'm genuinely sorry if you feel you can't voice your opinion based on my message. But as best as I can tell, that is a reaction to a) me pointing out exclusionary language or b) me pointing out logical problems with the arguments presented.
And if it's a) I must insist that the paradox of tolerance informs my decision here - if I can only choose between people feeling excluded for wanting generics or people feeling excluded because they can't make those people feel excluded, I will have to choose the latter. And if it's b) I must wonder why that isn't exactly the kind of technical, logical argument y'all are looking for.

To be clear, again, I have plenty of problems with generics in general and with the current stage of the design in particular. For example, I am on record as disagreeing with making usage of operators on type-arguments a central part of the design - I feel that it creates most of the complication in the design and I don't feel the benefit outweigh the cost. But I understand and respect Ian's choice on that. It's a technical point of contention and I politely disagree with him and live with that.

I've also said, plenty of times, that I think the main use-case for generics seem to be type-safe containers and that I feel the benefit of type-safety there is overstated. And experimenting with the current design for a while reinforced my impressions that some design decisions (like not allowing additional type-parameters on methods) hamper at least *some* of the non-container use-cases where Go could benefit from more type-safety. However, again, I understand why those decisions where made and I don't know of a way to solve these issues, so I'm left with accepting that they might be the best possible solution, even if I don't like them.

As it currently stands, I'm undecided if I like generics in Go and probably lean slightly against, given the current design (and would probably lean in favor, with some changes). The decision is not up to me though and I'm fine disagreeing with whatever decision is made - if it comes to that. And living with it.

I can't imagine any of these opinions about generics to earn me scorn or reprimands based on the CoC. Because the issue isn't *disagreeing* with generics or with voicing that opinion. It's *how* you voice it that matters and if you do so in a respectful and technical manner.

PS: Just make clear that I'm not claiming I'm perfect: I have, plenty of times in the past, said myself that people who want generics should just use Java or C++. I'm not proud of saying that. It was a mistake. I've done plenty of those and I will make plenty of them in the future and I can just hope I learn from them.

Anthony Martin

unread,
Dec 22, 2020, 2:09:42 PM12/22/20
to golang-nuts
'Axel Wagner' via golang-nuts <golan...@googlegroups.com> once said:
> What isn't welcome is your attempt of alienating people with a different
> viewpoint from yours and make them feel unwelcome. And if you continue to
> insist on doing that, the community *will* ask you to leave.

Please don't minimize or silence the lived experience
of people disproportionately affected by generics.

We should protect non-generic function bodies.

Concrete code matters.

Anthony

Carla Pfaff

unread,
Dec 22, 2020, 2:35:23 PM12/22/20
to golang-nuts
On Tuesday, 22 December 2020 at 20:09:42 UTC+1 al...@pbrane.org wrote:
Please don't minimize or silence the lived experience
of people disproportionately affected by generics.

We should protect non-generic function bodies.

Concrete code matters.

Tasteless attempt at humour.

burak serdar

unread,
Dec 22, 2020, 2:49:59 PM12/22/20
to Anthony Martin, golang-nuts
I also developed some horrendous code using generics in Java. I can
relate to the resistance many are having against generics. However,
there are some differences in the Go generics implementation that
makes me hopeful, so I suggest those who are opposed to it to give it
a chance and try it. This is not Java generics that were forced into
the language without changing the underlying JVM. Nor is it C++ (yet)
that you can't really do anything useful without writing lots of
cryptic code just to keep the libraries happy. A balanced approach in
the library that doesn't impose generics on developers at every
possible opportunity may go a long way.

>
> Concrete code matters.
>
> Anthony
>
> --
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/X%2BJD0mE0ZzY7AyM2%40alice.

Space A.

unread,
Dec 22, 2020, 3:08:06 PM12/22/20
to golang-nuts
  > I have, plenty of times in the past, said myself that people who want generics should just use Java or C++. I'm not proud of saying that. It was a mistake.

What if you actually were right? Have you ever been looking at it through "Clear is better than clever" prism? What if in 10 years you say: "Holy sh*t..." =) Sorry this might be my thought not yours.

I mean, what if lack of generics is actually one of the greatest feature of Go and we by all means should keep it like this. The fact is Go is great and successful without it, so do we really need to add anything? Because one of the key strengths is readability and clearness which you won't see anymore. And here you are, yet another boring language (I actually liked "write-only" term from one of comments above) which lacks so many features that others "had for years". Some ppl say "give it a chance", but giving something a chance means you can accept or deny if you don't like it. It's not a case because there is no magic switch you can turn on and off. There will be no way to reverse it.



вторник, 22 декабря 2020 г. в 16:07:20 UTC+3, axel.wa...@googlemail.com:

Ian Lance Taylor

unread,
Dec 22, 2020, 3:49:48 PM12/22/20
to Markus Heukelom, golang-nuts
On Tue, Dec 22, 2020 at 1:24 AM Markus Heukelom
<markus....@gain.pro> wrote:
>
> Why not issue a poll on generics, was this ever done? (I could've missed it, I am only following Go ~2 years). While the community has a vote in accepting/rejecting the current generics proposal, the community was never (really) asked if generics is desired in the first place and especially what the scope of generics should be. Is that correct?

I don't know of a poll specifically about generics. But for the past
several years we've done a Go community survey, and every year there
is significant support for adding generics to the language. For
example, although the results of the 2020 survey haven't been
assembled yet, you can see the results of the 2019 survey at
https://blog.golang.org/survey2019-results. In that survey when asked
"Which critical language features do you need that are not available
in Go?", 25% of the survey takers answered the question, and of those
79% mentioned generics. Previous years also showed support for adding
generics. Of course this isn't definitive, since there was no clear
way for people they say that do not want generics. But it's also not
definitive in a different direction, which is that by and large people
who don't currently use Go didn't take the survey, and probably some
of them would also want generics.

So while Go is not and never has been a poll-driven language, I think
it's reasonable to say that there is real support for adding generics.


> Another thought: there are many popular, type-safe programming language with generics already. So if you really need generics, there's plenty to pick from. There's not that many without, I can only name Go and C. So if generics is added to Go there's far less choice to pick a modern type-safe language that doesn't have generics. It's a feature that makes Go quite special.

Actually, C does have generics, through the preprocessor macro
mechanism. It's difficult to write, but it does provide the same kind
of functionality that would be available in Go if we added generics.
For example, here is a compile-time-type-safe vector implementation in
C:

https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/vec.h;h=cb871124ce2241402af05e4697a5e28904c462fb;hb=HEAD
https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/vec.c;h=85274c4e00c202e680761cef516bd17bb58b6261;hb=HEAD

Ian

Martin Hanson

unread,
Dec 22, 2020, 4:46:35 PM12/22/20
to golan...@googlegroups.com
> I don't know of a poll specifically about generics. But for the past
> several years we've done a Go community survey, and every year there
> is significant support for adding generics to the language.

So Ian, what you're saying is that for the future we can expect that
future development of Go will be driven by surveys? And each time there
is a significant support for adding or removing something, it will be
done?

If the future of Go is going to be dictated by surveys and as such what
the majority wants, then clearly Go needs to fork because a lot of us
will NEVER want that to happen. We're VERY happy with Go, just the way
it is.

Artur Vianna

unread,
Dec 22, 2020, 4:51:36 PM12/22/20
to Martin Hanson, golang-nuts
He did explicitly said in the last paragraph that Go is not driven by pools (aka surveys).

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

Martin Hanson

unread,
Dec 22, 2020, 4:57:34 PM12/22/20
to golan...@googlegroups.com
> He did explicitly said in the last paragraph that Go is not driven by
> pools (aka surveys).

Please re-read!

The problem is that his post is quite contradictory. On the one hand he
states that "Go is not and never has been a poll-driven language", yet
at the same time, "I think it's reasonable to say that there is real
support for adding generics" - because of the result of surveys!

Artur Vianna

unread,
Dec 22, 2020, 5:07:02 PM12/22/20
to Martin Hanson, golang-nuts
Ultimately Go is a community and polls are unavoidable. And even in the benevolent-dictator model, the dictator is forced by the community if the pressure is high enough, this has happened in a lot of projects like Vim and Python. And in Vim some changes only happened after the adoption of the NeoVim fork created community pressure.

The community will be the force driving the project whether you want it or not, the difference is that the Go team is actively seeking feedback, instead of letting the things get out of control, and only then patching it up.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

Martin Hanson

unread,
Dec 22, 2020, 5:09:25 PM12/22/20
to golan...@googlegroups.com
@Ian, if you're succumbing to outside pressure, please don't.

If you on the other hand is pro-generics to Go, then of course that is
your right.

I for one doesn't hope that the future of Go is going to continue down
this road, with new proposals for change popping up on GitHub every
other day and surveys and possible outside pressure determining the
future of Go. I would very much like to know if this is going to be the
way it is.

Martin Hanson

unread,
Dec 22, 2020, 5:13:27 PM12/22/20
to golan...@googlegroups.com
> Ultimately Go is a community and polls are unavoidable. And even in
> the benevolent-dictator model, the dictator is forced by the
> community if the pressure is high enough, this has happened in a lot
> of projects like Vim and Python. And in Vim some changes only
> happened after the adoption of the NeoVim fork created community
> pressure.
>
> The community will be the force driving the project whether you want
> it or not, the difference is that the Go team is actively seeking
> feedback, instead of letting the things get out of control, and only
> then patching it up.

That's fair enough, if that is how it is. Then surely forking Go is not
going to be a problem because a large enough part of the community is
very much against changing Go.

Axel Wagner

unread,
Dec 22, 2020, 5:40:37 PM12/22/20
to Martin Hanson, golang-nuts
On Tue, Dec 22, 2020 at 11:09 PM Martin Hanson <greenco...@yandex.com> wrote:
If you on the other hand is pro-generics to Go, then of course that is
your right.

Ian is on record, multiple times, as having argued in favor of generics in Go long before its open source release and has since written many proposals to add them - even before the Go community survey was a thing.

Again, it bears repeating: "The Go designers where against generics" is historical fiction. "The Go team is succumbing to public pressure" is political fiction. Both are simply false. Anyone saying either of those either misunderstood something someone on the Go team said, or is repeating from someone else who misunderstood something.

There are plenty of good reasons to criticize the addition of generics, but neither of these is one.

I for one doesn't hope that the future of Go is going to continue down
this road, with new proposals for change popping up on GitHub every
other day and surveys and possible outside pressure determining the
future of Go. I would very much like to know if this is going to be the
way it is.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

Ian Lance Taylor

unread,
Dec 22, 2020, 5:55:02 PM12/22/20
to Martin Hanson, golang-nuts
On Tue, Dec 22, 2020 at 1:46 PM Martin Hanson
<greenco...@yandex.com> wrote:
>
> > I don't know of a poll specifically about generics. But for the past
> > several years we've done a Go community survey, and every year there
> > is significant support for adding generics to the language.
>
> So Ian, what you're saying is that for the future we can expect that
> future development of Go will be driven by surveys? And each time there
> is a significant support for adding or removing something, it will be
> done?

No, that is not what I am saying.

I was replying to Markus Heukelom comments about a poll and about
whether the community was asked whether they (the community) wanted
generics.

Ian

Ian Lance Taylor

unread,
Dec 22, 2020, 5:57:36 PM12/22/20
to Martin Hanson, golang-nuts
I see no contradiction there.

These two statements can both be true: 1) the future of the Go
language is not determined by surveys; 2) we use surveys to find out
what Go users think.

Ian

Gerald Henriksen

unread,
Dec 22, 2020, 5:58:10 PM12/22/20
to golan...@googlegroups.com
No contradiction in the post.

He says clearly at the end that Go is not driven by polls

What he did do is show that the surverys do show support for the
inclusion of Generics, not that the surveys drove the decision to add
them.

Ian Lance Taylor

unread,
Dec 22, 2020, 6:04:43 PM12/22/20
to Martin Hanson, golang-nuts
I am in favor of adding generics to Go if it can be done while
preserving the clarity and simplicity of the language. See
https://blog.golang.org/why-generics (which I wrote).

I've been looking for ways to add generics to Go for a long time. For
example, here is a proposal I wrote up in 2010:
https://go.googlesource.com/proposal/+/refs/heads/master/design/15292/2010-06-type-functions.md.
And that wasn't even the first one I wrote. I hope they are at least
getting better over time.

Ian

Space A.

unread,
Dec 22, 2020, 6:19:25 PM12/22/20
to golang-nuts
> Again, it bears repeating: "The Go designers where against generics" is historical fiction. "The Go team is succumbing to public pressure" is political fiction. Both are simply false. Anyone saying either of those either misunderstood something someone on the Go team said, or is repeating from someone else who misunderstood something.

There is another possibility - you misunderstand something or someone and keep repeating that.

среда, 23 декабря 2020 г. в 01:40:37 UTC+3, axel.wa...@googlemail.com:

Axel Wagner

unread,
Dec 22, 2020, 6:51:27 PM12/22/20
to Space A., golang-nuts
On Wed, Dec 23, 2020 at 12:19 AM Space A. <reexi...@gmail.com> wrote:
> Again, it bears repeating: "The Go designers where against generics" is historical fiction. "The Go team is succumbing to public pressure" is political fiction. Both are simply false. Anyone saying either of those either misunderstood something someone on the Go team said, or is repeating from someone else who misunderstood something.

There is another possibility - you misunderstand something or someone and keep repeating that.

Sure. I might be wrong, I'm very willing to accept that possibility.
But "the Go designers where against generics" is an easily provable statement - just find a quote saying that.

And just to pre-empt the obvious retort: Yes, I absolutely would prove my side as well, but it's impossible to prove a negative - I can't prove that there are no statements of that nature. There is at least some evidence documenting what the official stance on generics has been, though:

• Ian provided an authoritative statement to that effect in this thread, as far as he, personally is concerned
• There is this FAQ entry: https://golang.org/doc/faq#generics - it was added two weeks before the open source release of Go, by Rob Pike, and documents the stance "generics might be added, if we can make them work" (which is notably different from "generics should not be in Go") https://github.com/golang/go/commit/dd64f86e08
• Russ Cox earliest documented stance I have at hand is from a couple of weeks *after* the open source release and it also is consistent with this position: https://research.swtch.com/generic

I can probably come up with more sources if I really want to invest the time. But I do feel confident that it is simply a well-documented fact, that the statement has always been "Go might get generics, if we can figure out a way to do it well". I am not aware of a single instance of anyone I would consider a core Go designer that would contradict it.

How that stance was contorted into "the Go designers don't want generics" or "Go will never have generics" is beyond me, even tough both of these have been very persistently repeated throughout the years (the latter has subsided a bit over the last two or three years, since it became apparent that there is a seriously hopeful design on the way).

But, again: By all means, I'm more than willing to be proven wrong. I haven't read everything any of them has ever said and I might very well have missed something.


среда, 23 декабря 2020 г. в 01:40:37 UTC+3, axel.wa...@googlemail.com:
On Tue, Dec 22, 2020 at 11:09 PM Martin Hanson <greenco...@yandex.com> wrote:
If you on the other hand is pro-generics to Go, then of course that is
your right.

Ian is on record, multiple times, as having argued in favor of generics in Go long before its open source release and has since written many proposals to add them - even before the Go community survey was a thing.

Again, it bears repeating: "The Go designers where against generics" is historical fiction. "The Go team is succumbing to public pressure" is political fiction. Both are simply false. Anyone saying either of those either misunderstood something someone on the Go team said, or is repeating from someone else who misunderstood something.

There are plenty of good reasons to criticize the addition of generics, but neither of these is one.

I for one doesn't hope that the future of Go is going to continue down
this road, with new proposals for change popping up on GitHub every
other day and surveys and possible outside pressure determining the
future of Go. I would very much like to know if this is going to be the
way it is.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.

Wojciech S. Czarnecki

unread,
Dec 22, 2020, 6:57:47 PM12/22/20
to golan...@googlegroups.com

Artur Vianna> you can keep writing your standard Go as it never existed.

L Godioleskky> those of us who want to ignore them can easily do so

Nope. You can neither pretend "it never existed" nor "ignore" no part of the language.
You as a programmer are supposed to read and *understand* a lot of other's code
before you will start to write your part.

--
Wojciech S. Czarnecki
<< ^oo^ >> OHIR-RIPE

Jeremy French

unread,
Dec 22, 2020, 10:40:12 PM12/22/20
to golang-nuts
I'd like to second the notion that the argument "if you don't like them, don't use them," is an invalid argument.  Anyone who's been in the game for any length of time knows that more than we'd like, we're repairing someone else's code, as opposed to writing our own from scratch.  If there is a bad or confusing way to write Go code, then it will be written that way by some, and we'll all be forced to deal with it.

It seems to me that part of the reason that Go was ever even a necessary experiment was because these other languages were trying to appeal to as many use cases as possible, and the complexity and awkwardness of those languages - as well as their reliance on their programmers to know the "right way" to write in the language - are an unavoidable consequence of succumbing to that temptation. I would channel Antoine de Saint-Exupery in this: “Perfection is Achieved Not When There Is Nothing More to Add, But When There Is Nothing Left to Take Away” 

I also think saying "If you want a Java-like experience, use Java" is not only not a personal attack, nor an exclusionary statement, it's a perfectly reasonable recommendation. Programming languages are not exclusivity clubs where if you use one, you're excluded from using another.  Using the right tool for the job is part of our profession.  But I think some people, myself included, find that easier to do when the tools don't all look and function the same way.  Having a programming language that is