Whitespace - An Explanation

Mailing List

Whitespace - An Explanation


Well, we got Slashdotted on April 1st, 2003, which turned out to be a particularly interesting day to be published. The web server took well over 400,000 hits (and coped admirably!). On this page, I'll attempt to answer some of the questions raised...

Is this an April Fool's Joke?

No, the publication date was purely coincidental, although possibly highly convenient. The compiler works, the examples work, and it is indeed possible to write your own programs.

Whether you'd want to is another question entirely. It was simply an idea born of a conversation between a few geeks in a pub in late 2002, who thought it was a fun idea. The actual implementation took no time at all (actually it took longer to put the web pages together... 2 hours to implement the programs and examples, and 3 hours to knock up the web page, if you're counting...)

It's possibly worth noting that the design came before the implementation, and the implementation came before the documentation and web site. That's the normal way to do things, no? ;)

Is it Turing complete?

Probably, although I don't fancy proving it. Let us know if you do... At the very least, I'm fairly sure it would be possible to implement a whitespace interpreter in whitespace. Again, let us know if you do...

It's been done before!

You can indeed use Perl's Acme::Bleach module (although we hadn't previously been aware of it). Of course, I'd argue that that's not quite the same - it's merely a different encoding of another language. Our whitespace has its own operational semantics and is a fully fledged language in its own right.

Didn't you know that python already has whitespace as syntax?

Yes, we did know. I quite like python, in fact. You might even have noticed that the language I chose to implement it in has whitespace as syntax. We never said "every" modern programming language ignored whitespace, just "most" of them. C, C++, C#, Java, Perl, Scheme all swallow whitespace, except perhaps as token delimiters.

Haskell? You strange man.

Well, haskell is my Language Of Choice. It makes it easy to do complicated things, and is particularly suited to implementing programming languages with its support for algebraic data types and complex data structures. I'd recommend it as worth a look for any serious programming fanatic who fancies a new challenge, or who simply has never dabbled with functional programming before.

Is there a practical use for Whitespace?

I doubt it.

What are people saying about Whitespace?

Here's some feedback we've had...

eb@dcs.st-and.ac.uk Released April 1st, 2003
Last Updated May 4th, 2004

Hosted by Durham University Computing Society