Tuesday, January 27, 2004
Hello world! Care to read your email?
Yes, this really is the classic program that prints “Hello, world!” when you run it. Unlike the elementary version often presented in books like K&R, GNU hello processes its argument list to modify its behavior, supports internationalization , and includes a mail reader.
hello - GNU Project - Free Software Foundation
Every program attempts to expand until it can read mail. Those programs which cannot so expand are replaced by ones which can.
Law of Software Envelopment
I didn't even realize GNU had a “Hello world” program available for downloading, much less one that succumbed to the Law of Software Envelopment. Granted, GNU then goes on to say:
The primary purpose of this program is to demonstrate how to write other programs that do these things; it serves as a model for all of the GNU coding standards.
It's quite amusing that GNU can turn this:
#include <stdio.h> main() { printf("hello, world\n"); }
into a 400k compressed download, complete with its own configuration
script, m4
macros (who uses m4
anymore?),
man
pages (and here I thought GNU was big on info
pages) along with documentation
in TeX, plus the various
language files for Russian, Slovanian, Japanese and I even think English is
included in there somewhere.
Quite amusing.
Note: technically, the code should be written as:
#include <stdio.h> #include <stdlib.h> int main(void) { printf("hello, world\n"); return(EXIT_SUCCESS); }
to be fully ANSI compliant, but hey, who am I to argue with the authors of C?
Then again, if you really want to be anal retentive about it, then:
#include <stdio.h> #include <stdlib.h> int main(void) { (void)printf("hello, world\n"); return(EXIT_SUCCESS); }
But that's just being silly …