- Whitespace (programming language)
Whitespace is an
esoteric programming language developed byEdwin Brady and Chris Morris at theUniversity of Durham . It was released on1 April 2003 (April Fool's Day ). Its name is a reference to so-called whitespace character codes in text files. When a text file is printed, whitespace codes move the cursor ahead without making any mark on the page thus leaving a white space. They include the codes for space, tab, and line feed. Unlike most programming languages, which ignore or assign little meaning to most whitespace characters, the Whitespace interpreter ignores any non-whitespace characters. Only spaces,tabs andnewline s have meaning. An interesting consequence of this property is that a Whitespace program can easily be contained within the whitespace characters of a program written in another language, making the text a polyglot.The language itself is an imperative
stack-based language . Thevirtual machine on which the programs run has a stack and a heap. The programmer is free to push arbitrary width integers onto the stack (currently there is no implementation of floating point numbers) and can also access the heap as a permanent store for variables anddata structures .Whitespace is said to have been proven
Turing-complete , [ [http://compsoc.dur.ac.uk/archives/whitespace/attachments/20070224/2792d9db/markov.zip Proof of Whitespace Turing-completeness] URL accessed July 13, 2007.] by an obscure post in the homepage mailing list archive, though the proof is yet to be reviewed.History
Whitespace was created by Edwin Brady and Chris Morris in 2002.
Slashdot gave a review of thisprogramming language on April, 1st 2003. The same year an interpreter for it was implemented in whitespace. The idea for this language was already mentioned five years earlier byBjarne Stroustrup .Syntax
Commands are composed only of spaces, tab stops and linefeeds. Data is represented in binary using tabs and linefeeds. All other characters are ignored and thus can be used for comments.
ample code
This prints "Hello World!". Note that whitespace characters have been given differently coloured backgrounds since, in practice, they are invisible. (Space, Tab)
empty-line empty-line empty-line empty-line empty-line empty-line empty-line/EOF
ee also
*
Brainfuck , another esoteric computer programming language that, similarly to Whitespace, ignores anything it doesn't recognize.
* Polyglot, a program valid in more than one language.
*Steganography References
External links
* [http://compsoc.dur.ac.uk/whitespace/ Whitespace homepage]
* [http://developers.slashdot.org/article.pl?sid=03/04/01/0332202 Release announcement on Slashdot]
* [http://search.cpan.org/perldoc?Acme::Bleach Acme::Bleach] APerl module that rewrites the body of your module to a whitespace-only encoding ("for "really" clean programs").
Wikimedia Foundation. 2010.