Edwin Brady and Chris Morris, who also developed the Kaya and Idris languages, created Whitespace in 2002 at the University of Durham. Slashdot published a review on April Fool's Day 2003.4
The idea of using whitespace characters as operators for the C++ language had been facetiously suggested five years earlier by Bjarne Stroustrup.5
Whitespace defines a command as a sequences of whitespace characters. For example, [Tab][Space][Space][Space] performs arithmetic addition of the top two elements on the stack.
A command is written as an instruction modification parameter (IMP) followed by an operation and then any parameters. 6
IMP sequences include:
Operator sequences, organized by IMP, include:7
but at least 1 item(top of the stack)is required
*Due to Haskell being lazily evaluated, the effect of the stack being too small may only show when, for example, invoking the outputting a number side-effect.
**The copy and slide operations were added in Whitespace 0.3.8
Characters other than space, tab and linefeed are ignored and thus can be used for comments.
A numeric value is represented as a sequence of space and tab characters that represent 0 and 1 respectively and terminated by a linefeed. The first character represents the sign of the value – space for positive and tab for negative. Subsequent characters before the terminator represent the binary digits of a value.
For example:
A label is used for control flow. It is a linefeed-terminated sequence of spaceand tab characters. As there is only one namespace, all labels must be unique. 9
The following source code is for a Whitespace "Hello, world!" program. For clarity, it is annotated with S, T and L before each space, tab, and linefeed.
When Whitespace source code is displayed in some browsers, the horizontal spacing produced by a tab character is not fixed, but depends on its location in the text relative to the next horizontal tab stop. Depending on the software, tab characters may also get replaced by the corresponding variable number of space characters.
"Whitespace". Compsoc. Archived from the original on 18 June 2015. Retrieved 8 December 2015. https://web.archive.org/web/20150618184706/http://compsoc.dur.ac.uk/whitespace/tutorial.php ↩
Parker, Matt (2019). Humble Pi: a comedy of maths errors. Allen Lane. p. 21. ISBN 978-0-241-36023-1. 978-0-241-36023-1 ↩
Timothy (1 April 2003). "New Whitespace-Only Programming Language". Slashdot. Retrieved 23 January 2014. http://developers.slashdot.org/story/03/04/01/0332202/New-Whitespace-Only-Programming-Language ↩
Stroustrup, Bjarne. "Generalizing Overloading for C++2000" (PDF). Florham Park, NJ, USA: AT&T Labs. Retrieved 23 January 2014. http://www.stroustrup.com/whitespace98.pdf ↩