Go, Open Source, Community - The Go Programming Language
The Go Blog Go, Open Source, Community Russ Cox 8 July 2015 Welcome [This is the text of my opening keynote at Gophercon 2015. The video is available here .] Thank you all for traveling to Denver to be here, and thank you to everyone watching on video. If this is your first Gophercon, welcome. If you were here last year, welcome back. Thank you to the organizers for all the work it takes to make a conference like this happen.
I am thrilled to be here and to be able to talk to all of you. I am the tech lead for the Go project and the Go team at Google. I share that role with Rob Pike. In that role, I spend a lot of time thinking about the overall Go open source project, in particular the way it runs, what it means to be open source, and the interaction between contributors inside and outside Google. Today I want to share with you how I see the Go project as a whole and then based on that explain how I see the Go open source project evolving.
Why Go? To get started, we have to go back to the beginning. Why did we start working on Go? Go is an attempt to make programmers more productive. We wanted to improve the software development process at Google, but the problems Google has are not unique to Google. There were two overarching goals. The first goal is to make a better language to meet the challenges of scalable concurrency. By scalable concurrency I mean software that deals with many concerns simultaneously, such as coordinating a thousand back end servers by sending network traffic back and forth.
Today, that kind of software has a shorter name: we call it cloud software. It’s fair to say that Go was designed for the cloud before clouds ran software. The larger goal is to make a better environment to meet the challenges of scalable software development, software worked on and used by many people, with limited coordination between them, and maintained for years. At Google we have thousands of engineers writing and sharing their code with each other, trying to get their work done, reusing the work of others as much as possible, and working in a code base with a history dating back over ten years.
Engineers often work on or at least look at code originally written by someone else, or that they wrote years ago, which often amounts to the same thing. That situation inside Google has a lot in common with large scale, modern open source development as practiced on sites like GitHub. Because of this, Go is a great fit for open source projects, helping them accept and manage contributions from a large community over a long period of time.
I believe much of Go’s success is explained by the fact that Go is a great fit for cloud software, Go is a great fit for open source projects, and, serendipitously, both of those are growing in popularity and importance in the software industry. Other people have made similar observations. Here are two. Last year, on RedMonk.com, Donnie Berkholz wrote about “ Go as the emerging language of cloud infrastructure ,” observing that “[Go’s] marquee projects … are cloud-centric or otherwise made for dealing with distributed systems or transient environments.” This year, on Texlution.com, the author wrote an article titled “ Why Golang is doomed to succeed ,” pointing out that this focus on large-scale development was possibly even better suited to open source than to Google itself: “This open source fitness is why I think you are about to see more and more Go around …” The Go Balance How does Go accomplish those things?
How does it make scalable concurrency and scalable software development easier? Most people answer this question by talking about channels and goroutines, and interfaces, and fast builds, and the go command, and good tool support. Those are all important parts of the answer, but I think there is a broader idea behind them. I think of that idea as Go’s balance. There are competing concerns in any software design, and there is a very natural tendency to try to solve all the problems you foresee.
In Go, we have explicitly tried not to solve everything. Instead, we’ve tried to do just enough that you can build your own custom solutions easily. The way I would summarize Go’s chosen balance is this: Do Less. Enable More. Do less, but enable more. Go can’t do everything. We shouldn’t try. But if we work at it, Go can probably do a few things well. If we select those things carefully, we can lay a foundation on which developers can easily build the solutions and tools they need, and ideally can interoperate with the solutions and tools built by others.
Examples Let me illustrate this with some examples. First, the size of the Go language itself. We worked hard to put in as few concepts as possible, to avoid the problem of mutually incomprehensible dialects forming in different parts of a large developer community. No idea went into Go until it had been simplified to its essence and then had clear benefits that justified the complexity being added. In general, if we have 100 things we want Go to do well, we can’t make 100 separate changes.
Instead, we try to research and understand the design space and then identify a few changes that work well together and that enable maybe 90 of those things. We’re willing to sacrifice the remaining 10 to avoid bloating the language, to avoid adding complexity only to address specific use cases that seem important today but might be gone tomorrow. Keeping the language small enables more important goals. Being small makes Go easier to learn, easier to understand, easier to implement, easier to reimplement, easier to debug, easier to adjust, and easier to evolve.
Doing less enables more. I should point out that this means we say no to a lot of other people’s ideas, but I assure you we’ve said no to even more of our own ideas. Next, channels and goroutines. How should we structure and coordinate concurrent and parallel computations? Mutexes and condition variables are very general but so low-level that they’re difficult to use correctly. Parallel execution frameworks like OpenMP are so high-level that they can only be used to solve a narrow range of problems.
Channels and goroutines sit between these two extremes. By themselves, they aren’t a solution to much. But they are powerful enough to be easily arranged to enable solutions to many common problems in concurrent software. Doing less—really doing just enough—enables more. Next, types and interfaces. Having static types enables useful compile-time checking, something lacking in dynamically-typed languages like Python or Ruby.
At the same time, Go’s static typing avoids much of the repetition of traditional statically typed languages, making it feel more lightweight, more like the dynamically-typed languages. This was one of the first things people noticed, and many of Go’s early adopters came from dynamically-typed languages. Go’s interfaces are a key part of that. In particular, omitting the ``implements’’ declarations of Java or other languages with static hierarchy makes interfaces lighter weight and more flexible.
Not having that rigid hierarchy enables idioms such as test interfaces that describe existing, unrelated production implementations. Doing less enables more. Next, testing and benchmarking. Is there any shortage of testing and benchmarking frameworks in most languages? Is there any agreement between them? Go’s testing package is not meant to address every possible facet of these topics. Instead, it is meant to provide the basic concepts necessary for most higher-level tooling.
Packages have test cases that pass, fail, or are skipped. Packages have benchmarks that run and can be measured by various metrics. Doing less here is an attempt to reduce these concepts to their essence, to create a shared vocabulary so that richer tools can interoperate. That agreement enables higher-level testing software like Miki Tebeka’s go2xunit converter, or the benchcmp and
The rest of this page is on the live site.