3 ms·
> Go is a general purpose programming language, just like C, C++, Java or Python. For example, I’ve been using Go for about 2 years and I’ve never written a sin
by movedx 9y ago
> Go is a general purpose programming language, just like C, C++, Java or Python. For example, I’ve been using Go for about 2 years and I’ve never written a single server in it.
This made me twitch because ultimately no argument should start with, "I use it this way and not that way, so change what you're doing." This was followed by:
> For this reason, when designing the Go language and it’s standard library, we need to approach it from a general purpose language perspective.
My understanding of what's being said here is simply: "I code in Go in this particular way, so it should be made to suit those requirements." Just because you don't write servers in Go it doesn't mean others don't. I personally enjoy the production ready HTTPS server and client on a daily basis. I'm constantly writing APIs in Go.
All I'm saying here is don't start by saying something doesn't suit your needs so it needs to change.
The rest of the article was great and gave me more insights into how Go works, so I thank you for that. And it's possible there is a better solution for context that should be considered for v2.
Thanks for the good read.
- adrianratnapala 9y agoI think it is fair enough for the author to say that since Go is a general purpose language, its APIs should not end up infected by a viral pattern needed for servers. So far, I think Go does a good job of using context.Context where it is needed and not letting it leak into things like io.Reader. But it is a tricky balance to strike, because the the author is right that the context pattern is viral by nature.
- movedx 9y agoTo a degree I can understand his, and your, view point here. However my understanding, which could be wrong, is that Go was designed to solve problems specific to Google. In my opinion that doesn't make it a general purpose language, that makes it a purpose driven language. It's general in nature in that you can ignore certain features and use it as a general language, but ultimately it has a built in HTTPS web server for a reason, right? And a programmer and an SRE, Context is an excellent idea for tracing requests through the whole stack -- again, there was a purpose to this design.
- adrianratnapala 9y agoWell I can't speak for Google about why it funds Go. My own observations are that Rob probably made Go just to be a language that he likes and that it is also a good fit for the way things are done at Google. I'm in the odd position that when I go to work as an SRE at Google, I hardly use Go, but at home I like to use it for hobby projects which are rarely servers. When I do use Go at work, it is for tools that I run on my workstation. So (a) even at Google there is more to life than servers, and (b) Go benefits from being attractive to people who are not at Google and/or not writing servers.
- movedx 9y agoThey fund it because they wanted a language to suit specific goals and be purpose built to address certain problems. Why does anyone make anything? To solve a specific set of problems -- positive side effects are a bonus, such as the solution being general purpose enough that it can be used for other tasks/problems too. Ansible has one goal in mind: configuration management. It can also talk to my toaster and send a Tweet when I pop some bread in there. I guess Ansible is a "general purpose" configuration management tool, except it's not :-) Terraform can be used to run a PowerShell script on a Windows box it never provisioned. I guess it's a scripting framework now. I think Go can be used as a general purpose language, but that's not how I see its design ethos. It caters to that crowd, but does have an underlaying goal I believe. As long as people are happy and things are working for them then all is well, I guess.