6 ms·
Sounds like a good design guideline, so I wouldn't call it unfortunate.
by mseepgood 4y ago
Sounds like a good design guideline, so I wouldn't call it unfortunate.
- Conlectus 4y agoAlgebraic data types (more technically sum types) are very much not “PhD level concepts”, despite the name. They’re just what C developers would call “tagged unions”.
- kaba0 4y agoEspecially when they will eventually have to walk back on their decisions a few years later, see generics..
- foldr 4y agoThey took the time to do it properly with input from experts on type systems (e.g Phil Wadler). The result is probably much better than what we'd have if the Go developers had quickly thrown together an implementation of generics 10-15 years ago. For example, the resulting type system is known to be sound.
- kaba0 4y agoNow it may be close to Java’s expressivity, 8 years ago. Now if they manage to cut down on verbosity it might surpass Java 8! How advanced!
- foldr 4y agoJava's generics implementation is certainly much more expressive as it's unsound :) People can write Java if they prefer. No programming language is going to please everyone.
- mseepgood 4y agoNot having generics was never a fixed decision. The FAQ said since day one that they "may well be added at some point" and that "The topic remains open", so there was no "walking back". By the way, not having ADTs is not a fixed decision either. You seem to mistake the fact that the Go team is in no rush to add things to the language as a general rejection of these things.
- Mawr 4y agoIt doesn't matter. What does is Go 1.0 shipped without generics. That single decision immutably affected the entire language. Now that generics have been retrofitted, the issues are clear as day: - Awkward transition period between a stdlib with and without generics: [1] - Completely different APIs for built-in data structures (slices, maps) and generic ones - Lack of obvious follow-up features that would have been there at 1.0 if generics were added, e.g. iterators [1]: https://github.com/golang/go/discussions/48287 https://github.com/golang/go/discussions/48287
- Patrickmi 4y agoWhere did you get the information that the Go team never wanted Generics, even the hype around having generics yet the stats shows 50% of Go developers wasn’t interested in it https://go.dev/blog/survey2022-q2-results https://go.dev/blog/survey2022-q2-results
- kaba0 4y ago50% of Go developers will never write a library, but they will definitely use one, and for that it is pretty much a must. We really shouldn’t cater to the average user, as they honestly don’t know what’s good for them.
- lanstin 4y agoI am not sure this is true. Every single go project I have seen at work has pkg/ and internal/ If anything, I wish people would have main.go be a bit longer so I can see the main bones of the application but people always like to a := app(conf) ; a.run()
- ilyt 4y ago50% of devs interested in feature is pretty high. Also generics is mostly stuff that make libraries more convenient, not average user code. It also reduces bugs where otherwise interface{} and type checking would be used.
- Patrickmi 4y agoIf you compare the amount of attention, language bashing, dedication and sweat being put in it I should expect the survey to show at least 75% adoption
- coldtea 4y ago>Where did you get the information that the Go team never wanted Generics By them acting as if they never wanting Generics, not having Generics from day zero, delaying their implementation for a decade with BS excuses, pretending they are some kind of unsurmountable problem.... They were literally pressureed into getting them in, after years of resistance, when they recognized the mess they've made
- ilyt 4y agoI sympathise with the idea but I do think they put the line in the sand too close. Go that had generics and sum types from the start would be my near-perfect GC-ed language
- coldtea 4y agoParent was being sarcastic. Those are basic concepts, already familiar to millions of Java, C# and other programmers...