I wasn’t going to say anything, but since ZDNet has republished the AWS “Sustainability with Rust” blog post, a short thread about why that post is misleading (at best) about Go. 1/
First, the “really interesting study a few years ago” has obvious problems. To start, it was published in October 2017, using Go 1.6 (Feb 2016), on an Intel i5-4460 CPU (Q2 2014). That’s forever ago. 2/
On top of that, the “really interesting study” assumes the Computer Language Benchmarks Game is a source of comparable programs, which is not remotely true if you know that site. 3/
Most obviously, if your study claims that C++ uses 34% more energy, 56% more time, and 14% more memory than C, it’s time to reexamine your assumptions. Approximately every C program is a valid C++ program, so C++ can’t lose, especially not that badly! 4/
All this is to say that the “really interesting study” is not really interesting. In fact it should clearly be viewed with a healthy amount of skepticism. 5/
Second, the summary of the Discord post about switching from Go to Rust is incredibly misleading. 6/
The original Discord post showed a single graph plotting both a Go server and the equivalent Rust server. The Rust line had more predictable performance and avoided the latency spikes in the Go line, but the lines were roughly comparable. 7/
Instead, the AWS post displayed the Go graph next to a graph of the Rust server after a significant rewrite to use new data structures and more RAM, circling “ms” vs “µs” time scales. This is either a complete misunderstanding of the Discord post or blatant dishonesty. 8/
As an aside, I’ve used that kind of scale change to make a point myself before (swtch.com/~rsc/regexp/re…). It’s a good way to make the point when you are showing an honest, fair comparison. But the AWS post wasn’t that. 9/
To be clear, the Discord post was fair. It showed an apples-to-apples comparison of a Go server and the equivalent Rust server. Much later in the post, it graphed the Rust server again, alone, with rewritten data structures and extra RAM. The AWS post misrepresents that. 10/
That said, the Discord post also describes Go 1.10, while Go 1.18 is due out soon. There have been many improvements in those eight releases, reducing GC pauses in programs with very large heaps or very many goroutines (and the Discord server had both). 11/
So the Discord latency spikes would be significantly reduced using a recent Go, and we also have plans to reduce them further. But still, Rust is a fine language for that server, and the team made a reasonable call. (Waiting for Go to improve could have worked too.) 12/
The AWS post does make some honest, fair points about Rust, which makes it even more of a shame that they included these misleading statements about Go. They didn’t need to do that. Rust is good enough to stand on its own. 13/
Personally, instead of reading blog posts that pretend Go vs Rust is some kind of zero sum game, I would much rather focus on ways that Go and Rust complement each other and can work well together. Like this post:
The top three pain points for Go users, in surveys and direct feedback, have been consistent for a number of years. They are: package management, generics, and error handling. We are working on all three. 2/
We started a conversation about error handling last August at GopherCon, with the release of the Go 2 design drafts. blog.golang.org/go2draft 3/
@mattfarina@Crell@sdboyer This is an absolutely fair criticism - we have not handled the community process around dependency management well. The core Go team was not involved early or often enough for that process to lead to a smooth landing. As tech lead for Go, that was my fault, and I apologize.
@mattfarina@Crell@sdboyer Ever since I wrote “go get,” we on the core Go team hoped the community would take care of dependency management. Keith Rarick's goven and then godep, and Matt Butcher's glide, and Dave Cheney's gb all seemed like promising steps toward a solution.
@mattfarina@Crell@sdboyer In spring 2015, Jason Buberel spent a while surveying these efforts and trying to understand how to unify them. The evidence he gathered clearly showed that a major impediment for all these tools was the lack of support in the go command for what we now call vendor directories.
@sdboyer I listened to your talk. You are clearly still quite frustrated and upset about all this generally and with me in particular despite our many hours of conversation. I am truly sorry about that. I know how that feels, and it sucks.
@sdboyer One recurring theme in your talk is the inability to write down incompatibilities, but that's not off the table for Go modules, as we've discussed.
@sdboyer - You *can* write down "use this with X 1.5 or later", which implicitly says "this is incompatible with X 1.4 and earlier".