On Tue, 12 Oct 2021 at 01:42, Ian Lance Taylor <i...@golang.org> wrote:
> On Mon, Oct 11, 2021 at 2:36 AM peter.m...@gmail.com > <peter.mcken...@gmail.com> wrote: > > > > I'm curious, was any consideration given to hiding generics behind a > flag in 1.18? The idea being it's such a complex feature that one could > imagine a backwards incompatible change being desirable if some weird issue > is found. > > Yes, we considered that idea, and decided against it. Since many > people are interested in generics, the effect would be to split the Go > ecosystem: many projects would immediately adopt generics, and many > wouldn't. Then as people depended on other packages, and those > packages started using generics, people who were otherwise not using > generics would be forced to turn them on in a haphazard process. It > seems better for the ecosystem to just permit generics everywhere. > > Ian > ISTM that in a sense, generics *are* behind a flag in 1.18, on a per-module basis at any rate - if your go.mod file doesn't declare a Go version of at least 1.18, then you can't use type parameters. > > > > On Monday, October 11, 2021 at 5:26:35 PM UTC+13 Ian Lance Taylor wrote: > >> > >> On Sun, Oct 10, 2021 at 2:55 AM nil...@gmail.com <nil...@gmail.com> > wrote: > >> > > >> > We are really excited about the coming generics support in Go, our > test drive of the generics support in 1.17 is so far pretty positive and it > would also allow us to immediately delete tens of thousands lines of code > from our main project. > >> > > >> > Our understanding is that Go team's current plan is to have the > generics support enabled by default in the 1.18 release scheduled for Feb > 2022. The question we are facing now is how much certainty we have on that. > I mean if generics could get delayed until 1.19, which would be 10 months > from now, then we should probably wait rather than switching to the full > use of generics now. > >> > > >> > Could someone from the Go team provide us some guidance please? Shall > we wait until the coming code freeze or maybe beta1 to expect more > clarification? > >> > >> The current expectation is that Go 1.18 will support generics. The > >> tip Go compiler already supports generics. There are bugs, but as > >> they are reported they are being fixed. It is reasonably likely that > >> some generics corner cases will not compile in Go 1.18, but the > >> expectation is that straightforward uses of generics will work as > >> expected. It is also likely that performance in Go 1.18 will not be > >> as good as it will be in later releases. > >> > >> Of course, it's impossible to guarantee this. Something completely > >> unexpected could happen. But that is the expectation. Hope this > >> helps. > >> > >> Ian > > > > -- > > 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+unsubscr...@googlegroups.com. > > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/a2b05910-9cdc-4fb4-94d5-61bd12812089n%40googlegroups.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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/CAOyqgcUK64FN9%3DYuo0xFTfAz%2Ban8eq9vwgX9rkcFsAdU0P%3DkfQ%40mail.gmail.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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAJhgacjO%2BjhB0WyV1H1vJxXxymP7gkvdNoqvZuHngkEVd3DURw%40mail.gmail.com.