Skip to content

3top1a/smallest-hello-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Smallest x86 64bit hello world in rust

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published