Skip to main content

An interpreter written in Python for the imperative, stack-backed language called Whitespace

Project description

Makefile CI PyPI version Python versions Python wheel

An interpreter written in Python for the imperative, stack-based language called Whitespace. This is a fork of https://github.com/rzuckerm/whitespace-python.

Installation

To install, simply use pip (or pipenv):

$ pip install whitespace3

Usage

Let program.ws be any Whitespace program. To execute it, type:

$ whitespace program.ws

You can find example Whitespace programs at tests/fixtures.

For example, here’s the factorial program:

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

Development

Recommended tools:

Clone the repository and install the dependencies:

$ git clone git@github.com:thecoolguy62aws/whitespace-python.git
$ cd whitespace-python
$ poetry env <python-version>
$ poetry install

where <python-version> is the version of python that you have installed. This must be at least python 3.8. Example for python 3.10:

$ poetry env 3.10

You’re now all set to begin development.

Formatting

The code is formatted using black.

Run the formatter:

$ make format

Linting

The code is linted using black and pylint.

Run the linters:

$ make lint

Testing

Tests are written using pytest.

Run all tests.

$ make test

Run a specific test module.

$ make test PYTEST_ARGS="-vvl -m test.<my-module>"

Run a specific test case.

$ make test PYTEST_ARGS="-vvl -k test.test_parser.ParserTestCase.test_it_parses_push"

Help

To get a list of make targets, run this:

$ make help

References

Credits

Thanks to Edwin Brady and Chris Morris for designing/developing this programming language; they are also developers of the Idris programming language.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

whitespace3-1.1.0.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

whitespace3-1.1.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file whitespace3-1.1.0.tar.gz.

File metadata

  • Download URL: whitespace3-1.1.0.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.13.5 Windows/11

File hashes

Hashes for whitespace3-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d370ac4fc3ce2aae456297dc1b1a1e204c0a8ade2575a9c0126928b1be154ba5
MD5 dd29ffccf366a6d8756103fe7f728c16
BLAKE2b-256 2f97ffcf0265b70ed517c3218529e67881c7552e76d810e036807edb02d05736

See more details on using hashes here.

File details

Details for the file whitespace3-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: whitespace3-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.3 CPython/3.13.5 Windows/11

File hashes

Hashes for whitespace3-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31a571ee471ff8e9a9647a78ba3ace699fb67fc75534099b71f9a65e7d0989f5
MD5 0be7f57710aaa946856a6b941b30825c
BLAKE2b-256 adc9d0ccbfb208471097d327948d43315871e78e7905918aff2762030f98334f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page