An interpreter written in Python for the imperative, stack-based language called Whitespace.
To install, simply use pip (or pipenv):
$ pip install whitespaceLet program.ws be any Whitespace program. To execute it, type:
$ whitespace program.wsYou can find example Whitespace programs at tests/fixtures.
For example, here's the factorial program:
$ whitespace fact.ws
Enter a number: 40
40! = 815915283247897734345611269596115894272000000000Recommended tools:
Clone the repository and install the dependencies:
$ git clone git@github.com:dwayne/whitespace-python.git
$ cd whitespace-python
$ pipenv shell
$ pipenv install --devYou're now all set to begin development.
Tests are written using the built-in unit testing framework, unittest.
Run all tests.
$ python -m unittestRun a specific test module.
$ python -m unittest tests.test_parserRun a specific test case.
$ python -m unittest tests.test_parser.ParserTestCase.test_it_parses_pushThanks to Edwin Brady and Chris Morris for designing/developing this programming language; they are also developers of the Idris programming language.