Also known as: static binary, statically linked binary
A static binary is an executable that bundles all the code it needs at build time, so it runs on its own — no shared libraries to find, no interpreter or runtime to install on the target machine.1
How it works
When a compiler builds a program, it links in the libraries the code calls. With dynamic linking those libraries stay separate and are loaded from the system at run time, so the binary depends on the right versions being installed. With static linking the linker copies the needed library code directly into the executable, producing one self-contained file. The result needs nothing external — not even a language runtime, unlike bytecode that requires a virtual machine.1
Trade-offs
The payoff is deployment simplicity: copy one file to a matching machine and run it, with no installer, no dependency hunt, and no “works on my machine” version skew. The costs are a larger file (every dependency is included) and that updating a bundled library means rebuilding the binary rather than patching a shared one.1 Paired with cross-compilation, a static binary makes shipping for many platforms a single, clean step.
In practice
Go produces a static binary by default, which is a major reason it suits CLIs, network services, and tools like GopherTrunk that ship to users who just want to run them. Rust and C can link statically as well, trading file size for the same dependency-free convenience.
Sources
-
Static library — Wikipedia, on static linking that copies library code into the executable versus dynamic linking against shared libraries. ↩ ↩2 ↩3