Skip to content

πŸ“¦ Comparing static binary sizes & memory of "Hello, World!" programs across languages using ❄️ Nix + Flakes.

License

Notifications You must be signed in to change notification settings

rezigned/hello-world-sizes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Hello World Sizes

πŸ“¦ Compare the static binary size and memory usage of "Hello, World!" programs across various languages.

Note

This project automatically builds and records binary sizes/memory usage of "Hello, World!" implementations for various languages like C, C++, Rust, Go, Zig, Nim, V, and more β€” all statically linked!

Binary sizes

Memory usage


πŸ“ 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 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.
  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 + Flakes by creating reproducible builds and comparing static binary sizes across languages.


πŸ“Š Reports

View historical reports under ./.github/reports/

About

πŸ“¦ Comparing static binary sizes & memory of "Hello, World!" programs across languages using ❄️ Nix + Flakes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •