Skip to the workspace
Pebellslearn by building
Learn a Programming Language  ›  Lesson

Go and Rust — Tools That Ship as One File

Go 12 minGo and Rust compile to native binaries that run without an installed runtime, which makes them easy to ship to many machines, with Rust adding memory safety without a garbage collector.

devops / Go and Rust — Tools That Ship as One File

Explore each scene at your own pace.

01 · The rule

The rule

Go and Rust — Tools That Ship as One File

Your Python health check works, and now fifty servers need it. Some have Python 3.8, some 3.12, one has none. Copying a script is easy; copying a working interpreter plus its libraries everywhere is not. This is exactly the problem compiled languages solve.

The rule

Compile once into a single binary; the target needs nothing else installed.

A compiled language turns your source code into a machine-code file ahead of time. Go goes further: by default it bundles the libraries your program uses into that one file. You copy it to a server and run it. No interpreter, no pip install.

Go can also cross-compile: from your laptop you can build a program for a different operating system and processor by setting two variables.

GOOS=linux GOARCH=amd64 go build -o healthcheck .
GOOS=linux GOARCH=arm64 go build -o healthcheck-arm .

That is why so much DevOps tooling is written in Go: Docker, Kubernetes, Terraform and Prometheus are all Go programs. Go is also simple on purpose, with built-in support for running many tasks at once, which suits network tools.

Rust also compiles to fast native binaries. Its headline feature is memory safety without a garbage collector: the compiler refuses code that could read freed memory or race on shared data. That makes it attractive for performance-critical, long-running tools, such as proxies and command-line utilities like ripgrep. The price is a steeper learning curve than Go.

Scene 1 of 5
Hover to wake the cannons. Drag to move, or use arrow keys when focused. Press Enter to fire a shot.