Brad Fitzpatrick on the future of the Go programming language (1.4, 1.5, & 2.0)
Authored by smcquay
photo credit: Nicolas Ravelli
Brad Fitzpatrick (@bradfitz) is a member of the Go team and the creator of memcached, OpenID and LiveJournal. He also works on Camlistore (“your personal storage system for life”). Thanks to Stephen McQuay (@smcquay) for contributing this liveblog post! - Sourcegraph
Note: The video will be online soon at dotgo.eu and tickets for dotGo 2015 are now available.
Hello Hacker News readers! Check out Sourcegraph, a code search & review tool for Go, Python, Java, Ruby, and JavaScript. Always free for open source and available soon for private/work code (sign up to be the first to get access).
—
State of the Gopher
Brad spent time marching through the history of Go since the 2009 open-source release with lists of features added for each release.
Original 2009 release:
Brad has worked on the stdlib and Camlistore since 2010. He gave a very brief history of Go’s open sourcing. He showed a screenshot of the golang.org page from 2009, including a screenshot of a video by Russ Cox talking about how fast Go is to compile and how fast it runs. Even in 2009 there were two compilers (gc, gcc), but at the time there was very little exotic hardware support (such as ARM). At the time of the OSS release, the site was already being hosted by a Go binary.
Originally, there were weekly releases which inspired (and necessitated) go fix, which translated backwards-incompatible changes. Then came the monthly releases. At this point there was still no go tool, so people used Makefiles.
go1.0:
- introduced better delete syntax.
- stability promise: new features will not break your programs.
- added the go tool we all know and love.
go1.1 (1 year later):
- method values
- terminating statement
- 64-bit int, etc.
- Previously Go had a naive conservative GC (“if it looks like a pointer, try cleaning it up”) then started getting a precise garbage collector, a GC that knows what every address in memory is supposed to be, which allows the GC to only look at pointers.
go1.2
- 3-index slice (can set cap), allows program to only pass very specific range of a slice into a func
- scheduler preemption
- go test -cover (test coverage)
go1.3 (no language changes)
- sync.Pool: helpful for controlling garbage
- GOOS added solaris, dragonfly, plan9 nacl
- precise GC of stack (mostly) with fallback to conservative GC
- move away from segmented stacks. Continuous stack allocations provided more consistent performance. He gave an example of decoding JSON with varying stack sizes and the new continuous method provides more consistent performance.
Present:
- Windows support
- many more docs
- community wiki
- books
All trends are up and to the right for Go development and usage. Things seem healthy.
People are using Go for cloud infrastructure. He cited many projects (Docker, Kubernetes, CoreOS, etc.).
Many conferences. Go Tokyo, Denver, Paris. India coming up. There is even a (CoreOS) gopher bus! There is a cool virtuous cycle of Go being built using tools built using Go (he mentioned CoreOS and Docker specifically). build.golang.org.
Go has better and better tools all the time. Started with godoc, gofmt, gofix, and he mentioned O(10) tools including and up to goreturns that expands “return err” to include zero values of the expected return values. Lots of cool and exciting tools, and they seem to be coming out faster these days.
The future of Go
go1.4
- has precise GC of everything
- beginnings of Android support
- syscall frozen
- pprof is now in Go, not Perl
- etc.
go1.5
- main theme is that the GC will be concurrent. Stop the world will no longer happen.
- iOS revival
- ppc64 and arm64
- removing more C
- the C-to-Go translation (talk summary from GopherCon 2014) will include steps to automatically clean up the code that is emitted by translator
- GOTRACE: emits Chrome trace viewer and will allow for us to visualize scheduler actions and more in Chrome
- NUMA-aware scheduler for better cache behavior
- etc.
go2.0: Will it ever happen? Who knows.
gccgo gets a mention. It’s keeping up with gc, and is superior in some ways (codegen, OS, arch), but still lacking in other ways (no precise GC, escape analysis).
gc, gcc, go/types (all different implementations of various parts of Go) help keep each other in check by finding bugs in the other implementations. He mentioned other interesting alternative compilers:
He’s jealous of these compilers since they’re written in Go, and gc isn’t (yet).
Q&A
Q: He skipped over go2.0; could you talk more about this? A: The reason to do 2.0 is to break things, and there is not consensus about what should, can, or deserves to be broken. No plans for 2.0 currently.
Q: How would you describe your role on go team? A: Supposed to be working on Camlistore 100%, but gets distracted by fixing bugs, responding to the mailing list, etc.
Q: Is Camlistore a real Google project? A: He thinks that Google is pacifying him. He started working on Go by adding to the stdlib to have functionality he used/needed in Camlistore. He figures if they have him working on Camlistore he will likely get distracted and fix Go bugs, so it works out well for Google.
—
Want to hear more from Brad? Follow him @bradfitz, check out his GitHub projects, and see his open-source contributions and influence on Sourcegraph.