Hacker GitHub

← All repos

tormol/tiny-rust-executable

View on GitHub ↗ ★ 18 Assembly

Using Rust to make a 137-byte static AMD64 Linux executable

11 mentions on Hacker News by 2 people: 0 stories, 11 comments · first 2018-09-22 · latest 2026-07-09

Mentions per year 11 mentions · busiest year 2020 (4)
20082026
  1. > way too big https://github.com/tormol/tiny-rust-executable This produces a 137 byte binary. Obviously AMD64 isn't used in embedded, but I've seen ARM ones that are in the ~256 range. It's all in how you use it. Of course, if you don't…
    comment by steveklabnik · 2026-07-09 · in Rewriting Bun in Rust
  2. https://github.com/tormol/tiny-rust-executable got it to 137, but here's a blog post explaining the process to get it to 151: http://mainisusuallyafunction.blogspot.com/2015/01/151-byte-...
  3. …really a fair comparison. The smallest "hello world" binary rustc has ever produced was 137 bytes. https://github.com/tormol/tiny-rust-executable
    comment by steveklabnik · 2021-01-03 · in Rust is now overall faster than C in benchmarks
  4. …for Rust is effectively the same as in C; the smallest binary rustc has produced is 137 bytes https://github.com/tormol/tiny-rust-executable The defaults do not focus on size reduction because we aren't in the 1970s anymore, though, it's…
  5. The smallest Rust binary ever produced was 145 bytes. https://github.com/tormol/tiny-rust-executable That is a bit extreme but it demonstrates the lower bound. There's a lot of things you can do to drop sizes, depending on the specifics of…
    comment by steveklabnik · 2020-07-16 · in Rust 1.45
  6. The smallest Rust binary that does something that I've ever seen is 145 bytes https://github.com/tormol/tiny-rust-executable (I saw a wasm one get a bit lower but that isn't really apples to apples)
  7. https://github.com/tormol/tiny-rust-executable (See also http://mainisusuallyafunction.blogspot.com/2015/01/151-byte-... which was the original implementation, this shaved a few more bytes off)
    comment by steveklabnik · 2020-01-05 · in Hello World
  8. …known one was 145 bytes. Some defaults were recently adjusted to make them smaller by default too. https://github.com/tormol/tiny-rust-executable
  9. …and it's not near the top of the list. That said, the smallest executable produced is 145 bytes: https://github.com/tormol/tiny-rust-executable
    comment by steveklabnik · 2018-11-25 · in Still in love with Rust
  10. …have done more work since then; the smallest binary rustc has ever produced is now 145 bytes: https://github.com/tormol/tiny-rust-executable
  11. …But that was before 1.0. Updating the example and applying some more tweaks, it’s down to 145: https://github.com/tormol/tiny-rust-executable
    comment by steveklabnik · 2018-09-22 · in A Programming Language Underdog