Home - wrelam/typo GitHub Wiki
Some notes from porting a 45 year old C program.
Origin
An e-mail thread came up on HackerNews featuring Doug McIlroy of UNIX fame asking about surprising Unix programs. One of his favorites was typo
, a program for identifying typos in text files. Dave Horsfall asked for source and Rob Pike linked to his own version of it written in Go, which also featured the original v4/5 C code.
Rob mentioned the difficulty of porting this program to work on a modern system, stating that this is mostly due to its dependence on the CPU, compiler, and linker in use at the time. The gauntlet had been thrown down.
Motivation
I enjoy C and am also interested in the history of the language along with the roots of UNIX. The challenge of porting a 45+ year old program seemed like a fun way to connect myself to that history.
Platform
Since this was originally a UNIX program, it seemed fitting to use a BSD as the first target. FreeBSD is the most popular (and forgiving), so I quickly setup a VM running FreeBSD 12.1 (amd64) and got to work.