Hello World

in #sail4 years ago

While small test programs have existed since the development of programmable computers, the tradition of using the phrase "Hello, World!" as a test message was influenced by an example program in the seminal 1978 book The C Programming Language.[3] The example program in that book prints "hello, world", and was inherited from a 1974 Bell Laboratories internal memorandum by Brian Kernighan, Programming in C: A Tutorial:[4]

main( ) {
printf("hello, world\n");
}
The C language version was preceded by Kernighan's own 1972 A Tutorial Introduction to the Language B,[5] where the first known version of the program is found in an example used to illustrate external variables:

main( ) {
extern a, b, c;
putchar(a); putchar(b); putchar(c); putchar('!*n');
}

a 'hell';
b 'o, w';
c 'orld';
The program prints hello, world! on the terminal, including a newline character. The phrase is divided into multiple variables because in B, a character constant is limited to four ASCII characters. The previous example in the tutorial printed hi! on the terminal, and the phrase hello, world! was introduced as a slightly longer greeting that required several character constants for its expression.

The Jargon File claims that hello, world originated instead with BCPL (1967).[6][unreliable source?] This claim is supported by the archived notes of the inventors of BCPL, Prof. Brian Kernighan at Princeton and Martin Richards at Cambridge.[citation needed]

For modern languages, hello, world programs vary in sophistication. For example, the Go programming language introduced a multilingual program,[7] Sun demonstrated a Java hello, world based on scalable vector graphics,[8] and the XL programming language features a spinning Earth hello, world using 3D graphics.[9] While some languages such as Perl, Python or Ruby may need only a single statement to print "hello, world", a low-level assembly language may require dozens of commands. Mark Guzdial and Elliot Soloway have suggested that the "hello, world" test message may be outdated now that graphics and sound can be manipulated as easily as text.