logoalt Hacker News

alfiedotwtflast Monday at 7:16 PM2 repliesview on HN

How small is a hello world in C on Linux? The last time I checked a few years ago, it was either 9Mb or 13Mb (memory is fuzzy on this one but one of them was right).

Edit: wow I’m way off… it must have been the 90s when I checked this lol


Replies

CyberDildonicsyesterday at 12:16 AM

C statically linked hello world binaries have never been 9MB or 13MB, they definitely weren't in the 90s. Also these are rust binaries.

https://github.com/MichalStrehovsky/sizegame

fluffybucktsneklast Monday at 7:54 PM

Yeah, testing here with GCC 13.3.0 led to 16K. Perhaps, when you made your test, the compiler was statically linking some libs, which would explain the massive increase in size.