119 points · by stablemap · 9y ago · 161 comments
The types also make it hard to change one small thing and make everything go wrong. Sure, the standard library source looks like a trainwreck, but it has structural strength. And it's easy to use.
Hmm. That's some great results, but is that survey representative of Go users as a whole? The respondents are self-selected, right?
I can imagine such a survey is reliable for things like best/worst features, how the language is used and other things that probably aren't correlated with enthusiasm for the language. Simply asking people who already chose to do a survey whether they like the language or not seems kind of pointless: if they didn't they'd presumably not bother spending time to say they didn't.
It is however illuminating how many of Go's developers are attracted by simplicity. The top adjectives for "like most" are: simplicity, easy, concurrency, simple, fast.
So that's 3 of the top 5 things people name basically being "it is simple".
On the other hand, the top "improve the most" adjective is generics.
This appears to put Go in a somewhat awkward spot. There's clearly a large population of developers who have been left behind by static typing and its consequent complexity (generics in particular being a fertile source of confusing error messages in most languages), and Go caters to these people, hence its attraction to former dynamic language users.
But at the same time, people are saying they want more complexity in the form of generics. If Go were to add good generics would it really be any simpler than Java? I'd struggle to identify any major complexity gap between them after that, unless you consider OOP to be too complex (unlikely given the Python/JavaScript backgrounds of many Go users?).
I wonder if it's the same people giving the top answers. Are Go users split into those who are happy with its current level of complexity and others who chafe against it? If so, is it possible for them to satisfy both camps simultaneously?
and:
>What changes would improve Go most? (first: Generics)
Number one issue mentioned.
So much for all those insisting that Go users have no issues with the missing Generics and don't miss/need them in practice.
There are just the N ways PL research has found for implementing generics. Either they implement them, and tackle the complication one of those N ways entails, or they don't.
Besides, has anyone seen much experiments, with actual coding or at least design, for finding this "non-complicated" way anyway? Not just some post once in a blue moon re-iterating the basic well known tradeoffs.
Proposal from Ian Lance Taylor, Go developer at Google
https://github.com/golang/proposal/blob/master/design/15292-...
View of Russ Cox, Go developer at Google
As for going further, I think covariance and contravariance, while conceptually simple, will always be too complicated to wrap your head around.
I think the future is invariant types + advanced generics functions. But research hasn't explored that direction yet. I might want to do that in the future.
If it's relevant to anyone's interest, feel free to contact me.
generics = 16%
management+dependency+package+dependency management = 38%
(what a crappy survey. I'm not sure is it even possible to just sum these)
I ran the numbers just now, and 571 responses contain the (case-insensitive) text substring "package manage" or "dependenc", compared to 623 for substring "generic". These two topics are very clearly the top two. They're also both on my list for this year (research.swtch.com/go2017). It doesn't seem that important which one "won".
If you have suggestions for how to summarize free-response text in a way that lets the data speak rather than lend itself to cherry-picking, please let us know. I'm certainly open to improved analysis next time.
generics = 16%
so it's a good chunk of the people who answered the survey.
2% mention types and 1% type system so it might be possible these come from people dissatisfied with the type system.
Finally, it's not clear whether people who mentioned dependency management where also counted in dependency and management.
All we know is that "generics" was the word the came out the most often.
So I applaud the Go architects with being conservative about it. More languages should take their time thinking about implementing features, no matter how needed they seem to be initially. You only get one chance, and then if it's a bad choice you live with the consequences.
[0] http://www.jprl.com/Blog/archive/development/2007/Aug-31.htm...
* JVM
* Haskell runtime
* ML family of languages
* Modula-3
* Ada
The problem with specialized generics in the runtime is that they bake the type system of the language into the runtime itself, making the runtime more difficult to work with. Type erasure, for instance, makes it much easier to implement alternative languages on the JVM such as JRuby, Clojure, Scala, or Kotlin, than on .NET.
As another example, C# in 4.0 added the concept of generic type variance, which is completely at odds with specialized generics. To implement this feature, the C# language designers had to modify the underlying runtime itself and add special bytecode instructions for the feature. The feature itself is also incompatible with specialized generics, so when you use it you silently lose specialization. In contrast, thanks to type erasure, the Scala language designers could easily add the same feature on top of the JVM as-is without needing Oracle to add special bytecode instructions.
Specialization has advantages for performance when doing number crunching with data structures and algorithms operating directly on integral or floating point data types. At the end of the day, though, if you really need performance for this very narrow field of use cases, you're probably not going to be using generic data structures and algorithms anyways. It takes an incredible amount of effort to build a data structure or algorithm that is both generic and also performant in all possible usage scenarios. It is however, much easier to build a data structure or algorithm that is specific and performant relative to your use case alone.
Case in point: when I was in college doing a NLP assignment that needed to be fast, my data structures were arrays of doubles because that was the easiest way to reason about and ensure performance.
When one language added a feature has no bearing to when another should add it.
Channels is specific concurrency paradigm. Java utilizes others, not less powerful.
(Honest question ... I'm interested to hear what you have in mind.)
How would Generics restrict you any more than the numerous variations on the same functions for different types (that you need today)?
Except if the alternative is using interface{} for everything, in which case, yes, Generics would be more restrictive.
If you keep dynamic dispatch, you pay almost no compilation penalty.
[1] yes, I'm a C++ programmer
If you are a C++ programmer then you know that the latest features that were added aim at making C++ programming simpler and easier. Adding something to a language to fix its flaws is not necessarily adding some complexity.
Go is designed to be a much simpler tool, with the spirit that constraints are liberating.
A simple macro system would maybe fit better the second philosophy than a significantly more complex type system.
So much for all those who claim generics remain overwhelming concern for Go developers.
There are, of course, some users, that can make substantial comments about design, but they cannot be represented in a survey.
Other similar answers:
2% easy to learn, 2% simple syntax, 2% simple language, 1% easy to use, 1% easy to write, 1% ease of use
In the case of generics there's another 1% answer on generic
[0] https://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=...
As I noted in a comment elsewhere on this page, if you have suggestions for how to summarize free-response text in a way that lets the data speak rather than lend itself to cherry-picking, please let us know. I'm certainly open to improved analysis next time.
> Other popular responses were GUIs, debugging, and error handling.
I really like the ease of defining Exceptions and just being able to "raise" them in Python - provides an easy early exit and the caller can handle them nicely in "except" clauses.
Edit: grammer
Instead of getting some abstract exception and stack trace over several pages, the error message is usually pretty specific. Yes, it forces to handle errors locally, but that is a good thing, because locally you know what can go wrong. Your user, who is going to be separated by several layers, won't know that and the specificity is a godsend to him.
What changes would most improve the Go documentation?
Collectively examples gets 26%
What Go libraries do you need that aren't available today?
Lots of demand for UI libraries and mobile support - both very hard to get right and would really require corporate backing. Sometimes I suspect large corporations (MS/Apple/Google) churn their OS APIs/languages simply to keep devs busy learning their one platform. This would be hard to do and hard to support long term.
What changes would improve Go most?
The G word comes first (not being worked on), and then package management (being worked on), also library discovery is highlighted as an issue. I'd prefer if they took a step back and prepared a Go 2.0 which removed some of the inevitable cruft (comments as directives, struct tags), and rethought some other features - mostly taking things out rather than adding things, though it would be nice also to see a solution to generics and better containers built-in.
And https://golangnews.com makes an entry in news sources, even if it is near the bottom :)
It'd be nice to see the raw data too (some of the data points require a bit of tidying up (mostly the write in responses for which 1-2 word breakdowns don't really help much and split up similar responses like example/more examples/examples/code examples/tutorials) and words like 'great' are not really helpful without context. Now that they have the data presumably they could merge some of those categories or if they released it others could look at this sort of thing for them.
Here's a chart that shows the number of new golang questions created on SO each month: https://apps.axibase.com/chartlab/c1acecc0/5/
golang is trending up, 20% increase year on year.
Obviously despite what some people kept on suggesting for years on HN, the 2 main concerns regarding the language are 1 - dependency management and 2 - lack of generics.
Strings and comments as band-aid meta-data is one of Go's glaring weaknesses.
That's not the same as a straight gender m/f question. I can imagine that some women felt they weren't under-represented and didn't primarily "identify as a woman" even if they were one. Consider the reverse question with s/woman/man/ - how many men would pick "I identify as a man" vs "I do not identify as part of an underrepresented group". It's a leading question. Bear in mind on that question the vast majority of respondents were just a shrug: either no response, explicitly saying they didn't want to answer, or not identifying as part of such a group.
I think it's a real shame that vi, VSCode, Atom, IntelliJ & Sublime Text come in ahead of emacs — emacs & go-mode are a wonderful way to write Go, particularly if one's using projectile or spacemacs. It's really worth a shot!
As usual you, coldtea, have posted an uninformed, polarising comment with the intent to provoke. Not surprised.
That crosses into personal attack and so is not allowed here.
coldtea is a forceful arguer but stands out in my mind as one of the users who has done the most to improve the quality of their comments (and thus HN) over the years by becoming more civil and substantive. Admittedly Go+generics isn't likely to hit any peaks of either civility or substantiveness.
We detached this subthread from https://news.ycombinator.com/item?id=13803300 and marked it off-topic.
Actually many have maintained exactly that, here on HN. Do you want me to post excerpts of such comments?
Heck, from this very thread: "I admit that I missed generics for the first several weeks but then just moved forward. Nowadays I don't really think I actually need them anymore."
>For at least a year several people on the Go team have acknowledged the demand for generics. Ian Lance-Taylor even added a doc to the go repo which summarised the entire discussion on the various possible implementations and their pros and cons.
I've read the summary, and most of the related blog posts. It has been close to a decade of Golang now. At which point can no practical progress in an area finally be considered as a neglect of indifference? After 7-10 more years?
Besides, regarding the acknowledgement I've posted sometime ago that I consider the standard "Generics are difficult, we just want to make sure we create them perfect before we attempt at adding them" position of the team as a discussion-stopper more than anything else. Perhaps you have some reason why I should be disallowed to be of and express that opinion? Because you don't seem satisfied to point that you consider it wrong.
>As usual you, coldtea, have posted an uninformed, polarising comment with the intent to provoke. Not surprised.
My intent is to express my position on the issue. Which is more or less the same, all these years, and I'm not sure why you'd expect that it should change, or that people who disagree with you should just shut up or something.
Plus, I don't care for your ad hominem.
It's been ~7 years, so there's still two more years before it reaches the amount of time it took Java to get generics.
I'm confident generics will come to Go (I sure hope so), but even if it doesn't, Go's impressive uptake shows that it's not something it desperately needs in order to be a successful language.
Or Docker guys hadn't used it?
I get the impression the Go devs have been stoking the flames a bit by refusing to countenance the extension of the language even into areas where it was clearly lacking.
They've been researching ways to add generics to Go for a long time, here is some background:
What does "right" mean? All kinds of languages, even pet projects, managed to implement them just fine.
Except if we mean "perfect, in a way that avoids all engineering tradeoffs".
But why would Generics especially need to be perfect in a language full of other engineering tradeoffs?
As a Go programmer since the 1.0 days, the concept of the GOPATH that existed when I started using the language is long gone.
In my ideal world, I should be able to clone a go project anywhere on my system, fetch the dependencies from the internet, yes the internet, because its 2017. (if you're that concerned with security fine, include them in your repo) but I should be able to call go build in that directory wherever it is.