Motivation and history

This program started out with two purposes: (1) to be my first, language-learning project in Go, and (2) to do a faster job than David Wheeler’s sloccount tool. At the time I was regularly taking statistical snapshots of NTPsec so we could talk about how much code we’d removed. I was dissatisfied with sloccount’s slowness, its large set of prerequisites, and its degree of unnecessary verbosity.

The program grew into more than that because I enjoy writing parsers. What was originally a translation of ad-hoc code evolved into a collection of generic language parsers driven by tables of syntax elements. Over time the number of distinct parsers decreased; they all got folded into what had originally been the parser for the C language family, the only one with quirk flags.

Eventually the goal became: I should be able to add the next language just by adding a row to the table driving the generic parser.

It became a game to see at each stage how many more languages I could express the relevant syntantic parts for before having to add capabilities (gated by quirk flags) to the framework.

I like learning new languages and this made wonderful motivation to taste a lot of them. And make comparisons from which I might learn. Eventually I ended up aiming at complete cioverage of historical langages and building a good tool for people soing archeology and forensics on large, messy source archives.

I ended up trawling the following sources to find languages to include:

See the Hacking Guide for how to add a language, or what to do to get me to add one.