Metadata-Version: 2.0
Name: whitespace
Version: 1.0.0b2
Summary: A Whitespace interpreter.
Home-page: https://github.com/dwayne/whitespace-python
Author: Dwayne Crooks
Author-email: me@dwaynecrooks.com
License: MIT
Keywords: whitespace
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Interpreters

Whitespace
==========

.. image:: https://img.shields.io/pypi/v/whitespace.svg
    :target: https://pypi.python.org/pypi/whitespace

An interpreter written in `Python <https://www.python.org/>`_ for the imperative, stack based language called `Whitespace <https://en.wikipedia.org/wiki/Whitespace_(programming_language)>`_.

Installation
------------

Install it using:

.. code-block:: bash

    $ pip install whitespace

You would now have access to an executable called ``whitespace``. Type

.. code-block:: bash

    $ whitespace -h

to learn more.

Usage
-----

Let's say you've written a `Whitespace`_ program and stored it in the file ``program.ws``. Then, to execute that program, type:

.. code-block:: bash

    $ whitespace program.ws

You can find example `Whitespace`_ programs at `tests/fixtures <https://github.com/dwayne/whitespace-python/tree/master/tests/fixtures>`_. Be sure to run them to see what they do.

For example, here's the `factorial program <https://github.com/dwayne/whitespace-python/blob/master/tests/fixtures/fact.ws>`_ and a sample execution:

.. code-block:: bash

    $ whitespace fact.ws
    Enter a number: 40
    40! = 20397882081197443358640281739902897356800000000

Development
-----------

Get the source code.

.. code-block:: bash

    $ git clone git@github.com:dwayne/whitespace-python.git

Create a `virtual environment <https://docs.python.org/3/library/venv.html>`_ and activate it.

.. code-block:: bash

    $ cd whitespace-python
    $ pyvenv venv
    $ . venv/bin/activate

Then, upgrade ``pip`` and ``setuptools`` and install the development dependencies.

.. code-block:: bash

    (venv) $ pip install -U pip setuptools
    (venv) $ pip install -r requirements-dev.txt

You're now all set to begin development.

Testing
-------

Tests are written using the `unittest <https://docs.python.org/3/library/unittest.html>`_ unit testing framework.

Run all tests.

.. code-block:: bash

    (venv) $ python -m unittest

Run a specific test module.

.. code-block:: bash

    (venv) $ python -m unittest tests.test_parser

Run a specific test case.

.. code-block:: bash

    (venv) $ python -m unittest tests.test_parser.ParserTestCase

Run a specific test method.

.. code-block:: bash

    (venv) $ python -m unittest tests.test_parser.ParserTestCase.test_it_parses_push

References
----------

- `Whitespace tutorial <http://compsoc.dur.ac.uk/whitespace/tutorial.html>`_

Credits
-------

Thanks to Edwin Brady and Chris Morris for designing/developing this programming language (also developers of the `Idris <https://en.wikipedia.org/wiki/Idris_(programming_language)>`_ programming language). I've had lots of fun playing with it and writing interpreters (in `Racket <https://github.com/dwayne/whitespace-racket>`_, `Haskell <https://github.com/dwayne/whitespace-haskell>`_, `Ruby <https://github.com/dwayne/whitespace-ruby>`_ and now `Python <https://www.python.org/>`_) for it.

Copyright
---------

Copyright (c) 2016 Dwayne Crooks. See `LICENSE </LICENSE.txt>`_ for further details.

.. _Whitespace: https://en.wikipedia.org/wiki/Whitespace_(programming_language)


Change Log
----------

`1.0.0b2`_ (2016-09-03)
+++++++++++++++++++++++

**Added**

- A change log (guided by http://keepachangelog.com/)
- Notes on installation, usage, development and testing to the README
- A version badge from http://shields.io/
- Begin tracking development dependencies

**Changed**

- Explicitly list the packages to be included in the distribution
- Stop including tests in the distribution
- Stop using ``codecs.open`` since ``open`` does the job in Python 3
- Consistently name test cases with a TestCase suffix

`1.0.0b1`_ (2016-09-02)
+++++++++++++++++++++++

**Added**

- A fully tested parser with error handling and source location tracking
- An interpreter
- A CLI for running the interpreter

**Fixed**

- Fix the console's output buffering by flushing after every write

`0.1.0.dev2`_ (2016-09-01)
++++++++++++++++++++++++++

**Changed**

- Update ``MANIFEST.in`` and ``setup.py`` to ensure the correct files are included in the distribution


`0.1.0.dev1`_ (2016-08-31)
++++++++++++++++++++++++++

**Added**

- A virtual machine
- A console abstraction to make it easier to test I/O
- The stack manipulation, arithmetic, heap access, flow control and I/O instructions

0.0.1.dev1 (2016-08-31)
+++++++++++++++++++++++

Birth!

.. _`Unreleased`: https://github.com/dwayne/whitespace-python/compare/v1.0.0b2...HEAD
.. _`1.0.0b2`: https://github.com/dwayne/whitespace-python/compare/v1.0.0b1...v1.0.0b2
.. _`1.0.0b1`: https://github.com/dwayne/whitespace-python/compare/v0.1.0.dev2...v1.0.0b1
.. _`0.1.0.dev2`: https://github.com/dwayne/whitespace-python/compare/v0.1.0.dev1...v0.1.0.dev2
.. _`0.1.0.dev1`: https://github.com/dwayne/whitespace-python/compare/v0.0.1.dev1...v0.1.0.dev1


