Go Debris (2019)
Go 1.13 is out and the Gophercon 2019 videos have been released; I have thoughts on both.
🔗 Go 1.13
Go 1.13 has been released; here are the changes I’m most excited about. This is ordered by importance.
The Error Wrapping Proposal (which I wrote about before) merged. They kept what I like and left out what I didn’t, which is nice.
Go modules have had a lot of work done. They are closer to default than before, the proxy (which speeds up use of modules and makes them safer to use) is officially released and on-by-default, and the related sumdb prevents MITM changes of existing releases.
Out of range panic messages now include the index that was out of bounds and the length (or capacity) of the slice. For example, s on a slice of length 1 will panic with “runtime error: index out of range  with length 1”.
Clearer runtime errors are always welcome.
The following three quotes are optimizations that I’m sure everyone will appreciate:
The compiler has a new implementation of escape analysis that is more precise.
This release improves performance of most uses of defer by 30%.
The runtime is now more aggressive at returning memory to the operating system to make it available to co-tenant applications. Previously, the runtime could retain memory for five or more minutes following a spike in the heap size. It will now begin returning it promptly after the heap shrinks.
Digit separators: The digits of any number literal may now be separated (grouped) using underscores, such as in
Coming from Perl, I’ve always been surprised digit separators are absent. It’s a relief for it to be added.
go version <binary> allows you to interrogate a compiled binary and see which
compiler built it. I wish it also surfaced the versions of the modules used and
the version of the binary itself, but this is still useful.
go build -trimpath is subtle but useful. Go has a lot of tooling to allow
reproducable builds, but in my experience they are very difficult to actually
achieve. This helps.
🔗 Gophercon 2019
Chris Hines - Death by 3,000 Timers: Streaming Video-on-Demand for Cable TV starts slow but ended up with some fascinating information about Go timers and how far a little optimization will go.
Jonathan Amsterdam - Detecting Incompatible API Changes is a topic I’m not especially interested in, but in discussing breaking changes subtle features in Go were illuminated in ways I’d never considered before.
Dave Cheney - Two Go Programs, Three Different Profiling Techniques went through a couple programs that could be optimized after some basic profiling. Almost anything involving profiling in Go is impressive, though (as you’ll see later) it’s almost a cliche to talk about at this point.
Yusuke Miyake - Optimization for Number of goroutines Using Feedback Control was hard to follow (both technically and due to accent) but fascinating nonetheless. I am really interested in how we can use feedback control (or more generally cybernetics) to optimize systems in real time.
Both Jason Keene - Dynamically Instrumenting Go Programs and Daniel Marti - Optimizing Go Code Without a Blindfold are yet more talks about either Go’s built in profiling support or using system level profiling. This is my bag so I am here for it, but I suspect it’s not as univesally appealing as the rest.
The remaining three talks are lightning talks, so are only seven minutes long.
Kevin Gillette - Forking Stdlib JSON
goes through doing some patches atop
encoding/json to simplify json encoding.
Frederic Branczyk - Continuous Profiling presents both the idea and tooling to do profiling, in production, all the time. Not especially polished, but I can definitely see this becoming a sort of standard for running code in production.
If you are interested in learning Go, this is my recommendation:
If you don’t already know Go, you should definitely check out The Go Programming Language. It’s not just a great Go book but a great programming book in general with a generous dollop of concurrency.
Another book to consider learning Go with is Go Programming Blueprints. It has a nearly interactive style where you write code, see it get syntax errors (or whatever,) fix it, and iterate. A useful book that shows that you don’t have to get all of your programs perfectly working on the first compile.Posted Mon, Sep 9, 2019
If you're interested in being notified when new posts are published, you can subscribe here; you'll get an email once a week at the most.