https://github.com/rezigned/hello-world-sizes
📦 Comparing static binary sizes of "Hello, World!" programs across languages using ❄️ Nix + Flakes.
https://github.com/rezigned/hello-world-sizes
flakes hello-world nix static-binaries
Last synced: 12 months ago
JSON representation
📦 Comparing static binary sizes of "Hello, World!" programs across languages using ❄️ Nix + Flakes.
- Host: GitHub
- URL: https://github.com/rezigned/hello-world-sizes
- Owner: rezigned
- License: mit
- Created: 2025-05-04T16:10:54.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-05-05T16:17:44.000Z (12 months ago)
- Last Synced: 2025-05-07T06:49:40.614Z (12 months ago)
- Topics: flakes, hello-world, nix, static-binaries
- Language: Nix
- Homepage:
- Size: 347 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hello World Sizes
📦 Compare the static binary size of a **"Hello, World!"** program across programming languages.
> [!NOTE]
> This project automatically builds and records binary sizes of "Hello, World!" implementations for various languages like C, C++, Rust, Go, Zig, Nim, V, and more — all **statically linked**!


---
## 📝 Rules
To ensure fair and meaningful comparisons:
* ✅ Each "Hello, World!" program must be idiomatic in its language (e.g. no inline assembly, etc.).
* ✅ Output must be a simple "Hello, World!" to stdout.
* ✅ Only statically linked binaries are allowed.
* ✅ Standard toolchains only (no exotic or size-optimized forks).
* ✅ Compiler optimizations (e.g. -Os, -s) are allowed and noted.
---
## 🧩 How to add a new language
1. Copy the [src/_template](src/_template) directory and and rename it to match the language name (e.g. `src/go`, `src/rust`).
2. Update `src/{lang}/flake.nix` to build a statically linked `hello` binary in that language.
3. Add the new language to the `inputs` and `langs` list in the top-level [flake.nix](flake.nix).
4. Run `nix run` to build the new language and generate a report.
---
## 🎯 Goals
The goal of this project is to help me learn ❄️ [Nix](https://nixos.org/) + [Flakes](https://nixos.wiki/wiki/Flakes) by creating reproducible builds and comparing static binary sizes across languages.
---
## 📊 Reports
View historical reports under [`./.github/reports/`](./.github/reports/)