Small Splendor

I have always been fascinated by tiny, simple programs. This probably stems from an interest in Amateur and Crystal Radios as a teenager. Often I would looks for articles in magazines and books about building one valve radios from spare and in-expensive parts. Those “valves” they referred to were vacuum tubes, and the art of building a radio sensitive enough to listen to weak signals while still having some fidelity was a fine art.

One organization that had an influence on me was Lindsay Books. They would send a catalog filled with books about building radios, Tesla Coils, and all sorts of other things. I still have my copy of my “1935 Amateur Radio Manual”. Extensive information about the right kind of wire to use in making coils for the radios and the proper methods to finish the wood cabinets so as to prevent signal loss.

Those exacting methods of creating radios still live with a minority of geeks today. Many create small computer programs; painstakingly designed to execute very quickly while fitting in the smallest space possible. To me these people are modern day heroes.

There are way too many programmers today (working mostly in a corporate environment) that build large inefficient systems for managing mundane things like billing and TPS Reports. Need to read an XML file? No problem, just find an XML library on the web and import the code into your project. What’s 100,000 SLOC between friends? This kind of attitude is pervasive in modern coding. Most modern server and desktop computers run at such great speed that writing code that can slow them down requires a particularly bad design.

Over the years, I have come across some really great examples of what I look up to. These are individuals that know how to create programs that are powerful with a complete feature set while maintaining a small stature.

Turbo C

Integrated development environment known for its small footprint of only 384KB of memory and inexpensive price.

Feature List

Encyclopedia Entry

Advertisement

Advertisement 2

Advertisement 3

Screenshot

JS1K

One kilobyte JavaScript demos showing off HTML 5 capabilities.

Minuet OS

This is an operating system written in assembly language. It has an impressive feature set while maintaining awe-inspiring performance.

femtolisp

Lisp interpreter in less than 1000 lines of code in C.

Tiny C Compiler

Written by Fabrice Bellard, this C Compiler is fast, lightweight and will bootstrap itself on almost any machine. Mr. Bellard is a winner of the International Obfuscated C Code Contest.

Toledo Nanochess

Mini command line chess program written in C. This chess engine supports the full rule set of the game, and offers challenging play even for experienced chess masters.

smallpt: Global Illumination in 99 lines of C++

Writing ray tracers is a favorite pastime of many computer science students. Ray tracing is an attractive problem to solve. It requires a little math, some optimization and returns beautiful images. There are several notable ray tracer examples on the web, however this one is extremely elegant. Not only does it support global illumination, it also supports multi-core processors all in 99 lines of C++ code.

MINILIGHT

a minimal global illumination renderer

Minilight is actually a ray tracer project that has been written in many different languages. The algorithm is specified and users have implemented them using the language of choice. This project could also serve as a form of Rosetta Stone to allow a comparison from one language to another.

kkrieger: First Person Shooter in 96 kilobytes

In my opinion kkrieger represents the greatest example of tiny programs. Written completely in assembly language, this program is a self-contained first person shooter. Most games have an engine that contains an executable that is less than 2 MB or so, but still have a requirement for map, texture, sound and other support files to operate. Kkreiger generates all models, textures and sounds using procedural generators. As a result, the game takes a while to boot while these entities are unpacked into the memory of your system.

Often I wonder why someone else has not considered using the same technique for a commercial game product.

Kkrieger is amazing and if you get the chance, it’s worth your time to have a look.