On Thu, Dec 24, 2020 at 7:15 AM Martin Hanson <greencopperm...@yandex.com> wrote:
> I therefore propose that the pro-generics camp provide real examples of > problems they have faced that was such a big issue that it justifies > adding generics to Go. > > Maintaining type safety is a lot easier with generics. Right now, my code base is littered with places where I push/pull from interface{} and wrap it in types to make it type safe for other parts of the code. That is a lot of boilerplate code I've written. And I need to maintain said code as it changes. With generics, I get a way to universally handle this, and I can ditch most of the boilerplate code. It mostly has to do with containers and data structures in my code. I need a heap over any type which can be ordered, and its needs to drag around any type of satellite data. Furthermore, I'd like to unbox satellite data, which generics will kick in a door for in the future. I'm also doing lots of TensorFlow, and if I had a proper shape-analysis phase in my compiler, .... Generics is a stepping stone toward that. -- J. -- 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/CAGrdgiX%3D1uXVc162MQ6shoaQ4r%3D3sc1x1y01eqpTY3StyYuuyg%40mail.gmail.com.