Skip to content

Latest commit

 

History

History
27 lines (23 loc) · 1.48 KB

README.md

File metadata and controls

27 lines (23 loc) · 1.48 KB

smallest-hello-rs

Smallest 64-bit Hello, World! in Rust in the World1. Follow up blog post available here. Using compiler/linker flags and a simple python script, I managed to get the size down from 276792 bytes (270KiB) to a mere 149 bytes. The binary is called hello and checked into git. For comparison, the smallest Windows Hello World! in Rust is 1536 bytes. There's still a LOT more space in the ELF header, as most of it is ignored.

Some very helpful resources:

Ideas

  • Put the whole message into one buffer, makes one less syscall
  • Mark all the editable fields with a special character
  • Go for a beer?

Footnotes

  1. Most probably, the only other one I was able to find was 151 bytes.