A computer jargon term used to describe all the characters that don't display any visible symbol. Besides the space character, whitespace also includes the tab character, the return character, the line break character, and in some environments, the non-breaking space character and other weird spaces.

In HTML, all sequences of whitespace characters in the codes are represented as a single space for presentation purposes, except in a <PRE> block.

Background

Whitespace is an imperative, stack-based programming language, freely available under the GPL. The thing that really sets Whitespace apart from other programming languages is that the only valid syntactic symbols are space, tab and line feed; all other symbols are totally ignored as comments. This means that a progam can, and often will, be entirely made up of white space, hence the name.

The first version was released on April 1st, 2003, and despite all indications to the contrary, the man responsible, Edwin Brady claims this date is merely a coincidence. At the time of writing, Whitespace has reached version 0.3, with new instructions facilitating recursion, albeit in a very convoluted and obfuscated manner.

Details

Whereas in `normal' languages such as Java, statements are delimited by semi-colons, and tokens by whitespace, Whitespace has no such luxury. Statement syntax has been cleverly crafted so as to make it unambiguous where one statement ends and another begins, despite there being no explicit marker. Statements have a hierarchical structure, with the first one or two tokens deciding the general type of operation, and the next one or two deciding the exact operation to be performed, followed by an argument in some cases. Arguments can be integers or characters, although both are given in binary, with the most significant bit indicating the sign. For the complete syntax, see http://compsoc.dur.ac.uk/whitespace/.

Conclusion

In the FAQ, the creator himself, Edwin Brady, admits,

    "Is there a practical use for Whitespace?

    I doubt it.".

That said, I am pretty sure Whitespace is Turing complete, that is; it is equipotent with any programming language you would care to mention. Java, C, ML, whatever. Although Whitespace is most certainly tongue-in-cheek, it is still fully functional, being about as syntactically developed as assembly code. Despite this, I think it will be a few years before we see Microsoft Visual Whitespace compilers appearing on the market.

At the moment, Whitespace is available in Haskell source code and Linux binary format. If you are planning on reading/writing Whitespace, I recommend the Emacs major-mode WS, which prints spaces and tabs explicitly (see below).

An example

You will forgive me if I do not create a large example - E2's storage can be put to better use; "Hello world!", for example, is 87 lines long and reasonably unfathomable. Here is a program that instead just prints "HI".

START   	  	  	
   	  	   
	
  	
  


END
Translated into the view you get from Emacs:
START[SPC][SPC][SPC][TAB][SPC][SPC][TAB][SPC][SPC][TAB]
[SPC][SPC][SPC][TAB][SPC][SPC][TAB][SPC][SPC][SPC]
[TAB]
[SPC][SPC][TAB]
[SPC][SPC]


END
In English:
  Push ASCII code 73 (I) onto stack
  Push ASCII code 71 (H) onto stack
  Output character on top of stack
  Output character on top of stack
  End
The result:
~/bin$ wspace hi.ws
HI

Log in or registerto write something here or to contact authors.