[FoRK] Superhuman feats of programming expression
<jbone at place.org> on
Sun Feb 3 10:13:55 PST 2008
..was Re: The Arc Challenge: Tastes great! Less filling!
You know, I hate to keep beating up Paul Graham's attempts to enable
us all to write less code. I'm HUGELY in favor of that! But when I
look around at real, massive feats of terse programming machismo...
I hate to say it, but the hands-down winner seems to be Haskell! For
example, LoCs in:
xmonad: 3683 # an X-windows window manager
darcs: 8381 # a distributed revision control system
frag: 11223 # an OpenGL first-person shooter
pugs: 38972 # beat the official Perl 6 by... *years*
zipper: 1001 # a toy OS / file system
...and the list goes on.* For just about every major category of
software you can imagine, some lone Haskell hacker (or group of
hackers) has put together a Haskell version that, relative to a
similarly-full-featured implementation in any other language, *is
smaller.* I won't even add insult to injury by mentioning that a
popular late-night or long-weekend hack for Haskell dabblers is
throwing together a toy Lisp or Scheme. (Oh well, there I went and
did exactly that. Point being, you sure as hell don't see the
opposite happening!) Cf.
Note that I'm completely omitting from this list the usual crop of
web servers, template systems, wikis, blog engines, etc. There are
many of those available in Haskell, but hardly worth mentioning as
they tend to clock in at such a small amount of code. (Note too that
the fact that all of the above are clocking in at order 10k LoC in
the case of the largest may in fact reflect an upper limit beyond
which no human being can even *think* about a Haskell program! ;-)
(Actually I have an existence proof to the contrary: House, an
rather serious bootable bare-metal OS written in Haskell, clocks in
at about 370k LoC. Not sure how much of that's the kernel.
Lightweight serious kernels have historically started at around 100k
on the very low side, early Plan 9 being the LoC leader AFAIK.)
Now, don't get me wrong; I'm EXTREMELY vexed about this state of
affairs, as Haskell is a programming language that, no matter how
many runs I've made at that fence, I can never seem to get anything
useful *done* in. I'm fine in theory, but when it comes to actually
stitching together IO and exceptions and all that, I find that my
head explodes. And I'm tired of cleaning gray matter and blood
splatter off the walls of my home office!
I'd MUCH rather see people doing this sort of thing in Lisp! Why
That's a serious question!
* Note that my incorrect recollection was that all of these came in
at around 4k LoC. Thus my previous humorous conjecture --- that
*any* program could be written in less than 4k LoC (or 5k, or
whatever) was clearly wrong. My bad. Made for a good joke, though.
More information about the FoRK