Linecount

This page is to measure the number of lines of source code of various types of program. That is useful for spotting extremely lean/minimal/simple programs and detecting insanity/bloat/excessive complexity.

The measurements are usually .c then .h.

If anything is wrong please feel free to update it or inform me.

Script
Here is a script to count lines of code:

find "$1" -name "$2" -exec wc -l {} \; | awk '{ SUM += $0 } END { print SUM }'

Thanks to http://stackoverflow.com/questions/1358540/how-to-count-all-the-lines-of-code-in-a-directory-recursively/16212299#16212299

it's important not to use xargs, there might be more files that command line handles. This is silently ignored and you get wrong results.

Shells
In the case of scsh we measure .scm, .c, .h

gnu bash:    138227,  13746 zsh:         135589,   5698 shivers scsh: 118475, 27131, 1985 templeos:    119115,      0 mirbsd mksh:  29223,   2562 debian dash:  16503,   2084 freebsd sh:   15453,   1622 es shell:      9017,   1436 plan9 rc:      5989,    327 execline:      3794,    117

bash has the highest linecount here. I think that is part of why the shellshock vulnerability happened.

Kernels

 * for plan9: Just the stuff inside `plan9/sys/src/9/`
 * for minix3: `minix/sys/` I hope that's correct.
 * for Mezzano by froggey, .lisp only, count the whole OS (includes a compiler, desktop programs).

linux-4.6-rc5: 15441922, 3878574 openbsd:       1963369,  911364 minix3:         377430,  262299 plan9:          229635,   25469 gnu hurd:       226383,   94836 templeos:       119115,       0 mezzano:         59763 seL4:            25916,   13017 xv6:              8173,    1181