Discussion on generics and the overuse of channels, etc in Go

Another interesting discussion:

Bill Kennedy is looking forward to generics:

I’m a fan of generics. I think that generics are gonna bring some really great things to the language, that we don’t have today, that I’d like to see. Now you can say “Bill, what is that?” I wanna see a package in the standard library that can implement as many of the concurrency patterns that we all have to code ourselves. I think there’s more bugs in Go code today because everybody’s writing their own pooling patterns, fan-outs, other complex things that could be coded by somebody on the language team where you just pass a function or something, and you know that the concurrency pattern is solid. So I’m super excited about that.

The sync.Map - look at the comments around the sync.Map type. You know somebody engineered that to be mechanically sympathetic with the hardware caching system, that you don’t get if you use a regular Go map? Imagine we could put a concrete type to that. I wouldn’t use a regular Go map ever again, because if I’m gonna be doing heavy, heavy map stuff, and I’m gonna get the mechanical sympathies of the caching system with that type, and I get to use a concrete type on top of that? WOOH!

Bill is also optimistic we’ll survive generics:

And I’m not worried about somebody abusing it, because we’ve seen a decade of people abusing channels, and we’re still here. [laughter] So we’re gonna survive.

Lots of good ideas in this epsisode. I purchased Bill’s book which likely contains these ideas – more on that later …