5 ms·
Stability is good is what's stable meets your needs. The more they stall adding stuff like generics the more painful (and more work for the tools and ecosystem
by coldtea 8y ago
Stability is good is what's stable meets your needs.
The more they stall adding stuff like generics the more painful (and more work for the tools and ecosystem to catch up) will be when they eventually cave in and do it...
And there will always be all the workarounds, third party solutions, and wasted efforts that would could have been avoided if something that could have been delivered early on (like e.g. package management) didn't come a decade late for no good reason.
At least now they've come up with a module/dependency system, which, even though a decade late, doesn't bring anything extraordinary to the table compared to what other platforms already had for ages.
Generics and error management remain before it makes sense to make it stable and boring for eternity...
- dilatedmind 8y agoWhen I think of generics i think custom data structures. Currently you are stuck with interfaces, but you can also wrap a library returning interfaces with methods operating on a specific type. I would be interested to hear about use cases that couldn't be solved in this manner
- tree_of_item 8y ago"Solved" by having lots of meaningless unsafe glue code. That's not a solution. It sounds like you're going to reject proposals for generics on the grounds that "you could just cast values of type `interface{}`" unless someone can show you a situation where you can't do that. The problem is that the people who want this sort of feature don't think that's even a solution.
- dilatedmind 8y agoI am legitimately asking, it's not something I have personally had much issue with. If you have some compelling example, please share your experience
- lederhosen 8y agoYou can not have a custom collection class containing objects _only_ of a certain type. For example ConcurrentHashTable<Int, String>. That is something that is used every single day. It is used so frequently that Go has generic slice and map built into the language. That is, they created a language with lots of special datatypes that can not be created in normal Go because of its lack of generics instead of creating generics. It is a bit like asking a Java-programmer to use Java 1.4. When you ask a Java programmer, or C# programmer or Haskell programmer or Swift programmer or... what they would change in the language you do not get the answer: remove generics.
- nordsieck 8y ago> You can not have a custom collection class containing objects _only_ of a certain type. For example ConcurrentHashTable<Int, String>. I'll start by saying - I largely agree with you. Libraries, particularly of data structures, are the biggest weakness of Go as a language. However, this bit is not really fair: > When you ask a Java programmer, or C# programmer or Haskell programmer or Swift programmer or... what they would change in the language you do not get the answer: remove generics. Much like values, language features need to be compared to each other, not evaluated in isolation. Everyone likes loyalty, but some people value it over honesty and some value the reverse. Everyone likes generics, but some people value faster compile times, a more simple language implementation and a lower learning curve more. Some people value it less.
- lederhosen 8y agoIf you value compile times (and you actually think generics make a difference, I do not) you would not make slices and hash tables generic like in Go, would you? If you wanted a simpler language, you would not make slices and hash tables generic, would you? If you wanted lower learning curve, you would not make special case generics would you? If you wanted to wait, to get the perfect generic solution because a sub-optimal one is not good enough, you would not create a sub-optimal non-perfect temporal solution with special-cased generics for certain data types would you? If you argue that I am loyal and not honest, and therefore like generics because it is used in my favorite language, I think you are wrong. The languages I use most of the time have a huge design flaw. It is called null. But when they created Go they chose to (except in special cases) get rid of (useful) generics instead of the disaster that is null. The problem is that Go has not learnt from other languages. It is too imperative, not expressive enough, lacking in static typing and horrible at fault handling.
- mseepgood 8y ago> At least now they've come up with a module/dependency system, which, even though a decade late, doesn't bring anything extraordinary to the table compared to what other platforms already had for ages. I don't think you fully grasp the breakthrough that the theory behind Go modules is for dependency management in general. It vastly improves on and simplifies anything that existed in this domain before. It's like saying Copernican heliocentrism didn't bring anything extraordinary to the table compared to Ptolemaic geocentrism. https://en.wikipedia.org/wiki/Copernican_Revolution#/media/File:Apparent_retrograde_motion.gif https://en.wikipedia.org/wiki/Copernican_Revolution#/media/F...
- ghthor 8y agoIt really does. Our codebase is very large and I'm a member of the team responsible for the build system and language tooling. Java library resolving in our repo can take 45mins from a clean build. Python is better, and we've managed to lock it down to offline only sources so libraries never update on us out of the blue. I've been a gopher since the the first announcement and I'm so excited that Russ Cox discovered a simple way to declare and resolve dependencies that avoids the SMT solver nightmare that I've seen bog down progress in every major project I've been involved in, from Ocaml and Haskell to python, java, rust and javascript (security nightmares every night here). One of my greatest hopes is I can convince my teammates that its be worth the time investment to transition all our dependencies management ecosystems into the Minimum Version Selection algorithm.
- unethical_ban 8y agoWhat am I missing? It's a dependency declaration file.
- etaoins 8y agoIt’s a slightly simplified version of Cargo which itself is an evolution of what yarn/npm/sbt/etc are doing. This is explicitly called out in the vgo paper. It only seems like a revolution because the previous situation in Go was such a mess. As someone that writes a lot of both Rust and Go I’m not nearly as impressed.
- coldtea 8y ago