News for hackers. Stuff that matters.
Re:Map[string]interface{} in Go: a user's manual by mseepgood on Monday July 26, 2021 @03:46PM (#27964434)
> purely for ideological reasons

There are no ideological reasons.

https://github.com/golang/go/commit/dd64f86e0874804d0ec5b713... "Generics may well come at some point."

https://golang.org/doc/faq#generics "A language proposal implementing a form of generic types has been accepted for inclusion in the language. If all goes well it will be available in the Go 1.18 release."

One of the language designers explaining the motivation for adding parametric polymorphism to Go: https://www.youtube.com/watch?v=RIvL2ONhFBI&t=1064s

Explaining the benefits of generics: https://www.reddit.com/r/golang/comments/jditu9/what_do_gene...

From the Featherweight Go paper: https://arxiv.org/pdf/2005.11710.pdf "Recently, the Go team mooted a design to extend Go with generics, and Rob Pike wrote Wadler to ask: Would you be interested in helping us get polymorphism right (and/or figuring out what “right” means) for some future version of Go?"

Re:Map[string]interface{} in Go: a user's manual by ibraheemdev on Monday July 26, 2021 @04:29PM (#27965020)
Yup, it's a common misconception that Go language designers are anti-generics. They wanted to include generics, the reason they were left out is that there was no clear way to include them without significant downsides:

> The generic dilemma is this: do you want slow programmers, slow compilers and bloated binaries, or slow execution times?

> I would be happy to learn about implementations that somehow manage to avoid all three of these bad outcomes, especially if there were good written descriptions (papers, blog posts, etc.) about what was hard and why it's a good approach. I'd also be interested to see good written descriptions of trying one of those approaches and what went wrong (or right).

- Russ Cox (2009): https://research.swtch.com/generic

Re:Map[string]interface{} in Go: a user's manual by paulddraper on Tuesday July 27, 2021 @03:05AM (#27969481)
> do you want slow programmers, slow compilers and bloated binaries, or slow execution times?

Which one did Rust choose?

Re:Map[string]interface{} in Go: a user's manual by mseepgood on Tuesday July 27, 2021 @08:02AM (#27971413)
slow compiler