Brian Raiter, proprietor of Muppet Labs, has created an astoundingly wonderful exercise showing how to create a Hello, World executable in quite literally as small a space as possible. I honestly can’t remember where I found this page. When I first started reading it I thought, ho hum, here’s another grad student trying to see how many optimizations they can trick gcc into accepting at once.

What I found, refreshingly, was a romp through the actual contents of an ELF executable and a lot of very good forensic engineering and creative thought to figure out how to get rid of the overhead. This is precisely the kind of engineering effort that embedded engineers do every day, and it is very easy to forget in today’s world of Android and Meego and other userland environments that require hundreds of megabytes of RAM and fast processors even to run at all. Most refreshing was the highly didactic style in which Brian writes.

Be sure to also read the writeup of the rest of Brian’s collection of tiny (and very educational) programs.