Giter VIP home page Giter VIP logo

whitespace's Introduction

Whitespace April Fool

The Whitespace programming language gained some notoriety when a Slashdot article mentioned it on 1 Apr 2003. I wanted to revisit the language to celebrate the 21st birthday of its fame.

Dependencies

You will need a whitespace interpreter. The original is still available online, courtesy of the Wayback Machine, but it needs a couple of source tweaks to work with modern Haskell compilers. There's a patch file at WSpace.patch; if you've downloaded and unpacked v0.3, so you have WSpace in your current directory, patch it with patch -p0 < WSpace.patch; you should then be able to cd WSpace; make.

Alternatively, there's a long list of interpreters at https://github.com/wspace/corpus, many of which are written in languages that you'll likely already have installed on your machine. However, many of the interpreters I looked at were incorrect in various ways, e.g. getting the order of operands wrong for arithmetic operations; other programs on that list were libraries, but didn't provide a command-line interface. https://github.com/kraterkraken/Whitespace provides a main() that takes the name of a file to run.

Source

The file apr1.ws is, effectively, a "Hello world". However, the obvious way of writing a hello world in Whitespace is to push 72 (H) onto the stack, print the character with the ASCII code at the top of stack, then push 101 (e), print it, etc. This is what the Wikipedia example does. The code here uses more of the language features (addition, subtraction, multiplication, modulo, storing/retrieving from the heap, and looping), and (I assert) is more interesting as a result.

The file apr1.c is that same Whitespace source but also a valid C program that implements approximately the same operations to print approximately the same message.

Screenshot

whitespace's People

Contributors

nsw42 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.