Doug McIlroy has another interesting post on TUHS. This time it’s about Unix programs that he found surprising. Many of the programs have been replaced by updated tools and are no longer used by most people but they all offer something surprising. Very often, the surprise is the novel application of theory to a seemingly “simple” problem.

For example, dc is the Unix Desk Calculator, a Reverse Polish Notation calculator that featured arbitrary precision arithmetic. At each step, dc performed a backward error analysis to determine the precision needed to achieve the end precision requested by the user. McIlroy says that to this day he haven’t seen another program that does that.

Another surprise is typo , a sort of primitive spell checker that ranked words based on their similarity to other words in the document. The idea wasn’t really to serve as a spell checker but to catch typos. The program worked by counting trigram frequencies but the memory on the first Unix machines was so limited that typo used a probabilistic method to update the 1 byte counters to account for large counts. Rob Pike says that typo was written so close to the machine that he couldn’t port it to newer machines and had to rewrite it in Go.

There are some other gems in McIlroy’s list so take a look. A final surprise is that many of these programs were written by women. That wouldn’t occasion much comment today but back when these programs were written, women were much rarer in our industry.