Your source for diverse discussions from around the Go community. This show records LIVE every Tuesday at 3pm US Eastern. Join the Golang community and chat with us during the show in the #gotimefm channel of Gophers slack. Panelists include Mat Ryer, Jon Calhoun, Carmen Andoh, Johnny Boursiquot, Angelica Hill, Mark Bates, Kris Brandow, and Natalie Pistunovich. We discuss cloud infrastructure, distributed systems, microservices, Kubernetes, Docker… oh and also Go! Some people search for GoTime or GoTimeFM and can’t find the show, so now the strings GoTime and GoTimeFM are in our description too.
So do we like Generics or not?
So, do we like generics or not? Some people feared they’d be the end of the language. Others were very hopeful, and had clear use cases, and were thrilled about the feature coming to the language. It was also often touted as the reason a lot of people didn’t adopt Go. So what do we think now? Mat and Kris are joined by Roger Peppe and Bryan Boreham to discuss the state of Generics in Go.
Changelog++ members save 1 minute on this episode because they made the ads disappear. Join today!
Sponsors:
- Fastly – Our bandwidth partner. Fastly powers fast, secure, and scalable digital experiences. Move beyond your content delivery network to their powerful edge cloud platform. Learn more at fastly.com
- Fly.io – The home of Changelog.com — Deploy your apps and databases close to your users. In minutes you can run your Ruby, Go, Node, Deno, Python, or Elixir app (and databases!) all over the world. No ops required. Learn more at fly.io/changelog and check out the speedrun in their docs.
- Typesense – Lightning fast, globally distributed Search-as-a-Service that runs in memory. You iterlly can’t get any faster!
Featuring:
- Roger Peppe – Twitter, GitHub
- Bryan Boreham – Twitter
- Mat Ryer – Twitter, GitHub, LinkedIn, Website
- Kris Brandow – Twitter, GitHub
Show Notes:
- New slices package
- Go 1.21 release notes
- Roger’s talk on unconstrained generics
- Roger’s proposal on type assertions
- Roger’s generics mini testing framework
- Mat’s mini testing framework
- Dishwasher video
- Dishwasher video v2
Something missing or broken? PRs welcome!
Timestamps:
(00:00) - It's Go Time!
(00:45) - Roger Peppe
(02:22) - Bryan Boreham
(02:57) - Overview of generics
(06:25) - [Square brackets]
(08:09) - Roger's generic use
(19:37) - Constraints
(26:45) - Proposal for type switching
(30:01) - The error interface
(30:51) - Roger's Qt project
(35:45) - How do generics make you feel?
(43:56) - Go 1.21
(47:18) - Maps package
(49:41) - Unpopular opinions
(50:01) - Mat's unpop
(50:45) - Roger's unpop
(59:25) - Bryan's unpop
(1:03:55) - Kris' unpop
(1:11:04) - Mat's 2nd unpop
(1:12:01) - When Mat called a guy homeless
(1:22:11) - Universal jokes
(1:26:59) - Outro