Whitespace (programming language)

Whitespace (programming language)

Whitespace is an esoteric programming language developed by Edwin Brady and Chris Morris at the University of Durham. It was released on 1 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 and newlines 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. The virtual 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 and data 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 this programming 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 by Bjarne 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] A Perl module that rewrites the body of your module to a whitespace-only encoding ("for "really" clean programs").


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • Programming language — lists Alphabetical Categorical Chronological Generational A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that… …   Wikipedia

  • Esoteric programming language — An esoteric programming language (sometimes shortened to esolang) is a programming language designed as a test of the boundaries of computer programming language design, as a proof of concept, or as a joke. There is usually no intention of the… …   Wikipedia

  • Python (programming language) — infobox programming language name = Python paradigm = multi paradigm: object oriented, imperative, functional year = 1991 designer = Guido van Rossum developer = Python Software Foundation latest release version = 2.6 latest release date =… …   Wikipedia

  • MUF (programming language) — MUF (short for Multi User Forth ) is a Forth based programming language used on TinyMUCK MUCK servers and their descendants, including Fuzzball MUCK, ProtoMUCK and GlowMUCK. MUF is the system programming language for TinyMUCK systems. Many… …   Wikipedia

  • C (programming language) — C The C Programming Language[1] (aka K R ) is the seminal book on C …   Wikipedia

  • Lisp (programming language) — Infobox programming language name = Lisp paradigm = multi paradigm: functional, procedural, reflective generation = 3GL year = 1958 designer = John McCarthy developer = Steve Russell, Timothy P. Hart, and Mike Levin latest release version =… …   Wikipedia

  • Forth (programming language) — infobox programming language name = Forth paradigm = Procedural, stack oriented year = 1970s designer = Charles H. Moore typing = typeless dialects = colorForth, Open Firmware implementations = Forth, Inc., GNU Forth, MPE influenced by =… …   Wikipedia

  • B (programming language) — infobox programming language name = B caption = file ext = paradigm = year = 1969 designer = Ken Thompson developer = Ken Thompson, Dennis Ritchie latest release version = latest release date = latest test version = latest test date = turing… …   Wikipedia

  • Cola (programming language) — Cola is a programming language similar to Java and C# with some higher level features of Perl and Ruby including first class regular expressions. It can be compiled for the Microsoft .NET CLR or the Parrot virtual machine. Cola is a compiled… …   Wikipedia

  • FOIL (programming language) — FOIL was the name for two different programming languages. CAI style languageThe first FOIL was a CAI language developed at the University of Michigan in 1967. The acronym stood for File Oriented Interpretive Language and it was very similar to… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”