3 ms·
What kind of new libraries are we going to get with this change? Seems like we'll see a proliferation of new data structure libs now that they can be constructe
by maxmcd 6y ago
What kind of new libraries are we going to get with this change? Seems like we'll see a proliferation of new data structure libs now that they can be constructed without interface{}. What else?
- jerf 6y agoLibraries that assemble channel structures, and libraries that may not provide that functionality but depend on it internally, i.e., libraries that can set up entire structures of goroutines that use channels under the hood. (Probably another burst of "worker pool" libraries will pop up before once again the community points out that native Go essentially provides worker pools with a natural use of existing constructions already.) While this is a subset of "new data structures", I'm really looking forward to generic immutable structures that can be read by many goroutines but have some coherent update story. I've got several places in my code where I have a structure I want to update infrequently and have read access in a lot of places, where I'm reading it enough that a traditional read/write lock is a real problem. I've got some stuff hacked together but what I have can't be shared as a library, and I shouldn't anyhow, because a real library ought to be stronger and better. (I recognize that Go doesn't have immutable data types, but I was programming in Python for many years before Go and have made my peace with "Just don't do that.") Libraries that operate on maps and slices in a type-agnostic manner. Probably some numeric libraries with nicer types than you can get now, though I still think Go will be a bad choice for highly numeric code even post-generics. Several hundred map/filter/reduce libraries that nobody will use for very long. Data structures are the one I'm really looking forward to, though. Network servers, nominally Go's wheelhouse, is one of those places that we tend to like some obscure data structure choices because of the performance needs. It has been a frustrating hole in the language for a while.
- maxmcd 6y agoThanks, this was super informative