= loccount designer's notes =
by Eric S. Raymond

== 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:

Comparison of programming languages (syntax)::
    https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(syntax)[]

Comparison of programming languages (strings)::
    https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(strings)

Baylor Computer Science Programming Archive::
    http://cs.ecs.baylor.edu/~maurer/SieveE/[]

List of programming languages::
    https://en.wikipedia.org/wiki/List_of_programming_languages[]

Comments::
    http://www.gavilan.edu/csis/languages/comments.html[]

ACM "Hello World!" project::
    http://www2.latech.edu/~acm/HelloWorld.shtml
    
Kate editor's list of 450 supported languages::
    https://kate-editor.org/ja/syntax/

Rosetta Code language list::
    https://rosettacode.org/wiki/Category:Programming_Languages

Tokei language list::
    https://github.com/XAMPPRocky/tokei/blob/master/languages.json

gocloc language list::
    https://github.com/hhatto/gocloc/blob/master/language.go

See the link:hacking-guide.htm[Hacking Guide] for how to add a
language, or what to do to get me to add one.

// end
