Giter Club home page Giter Club logo

bluespace's Introduction

BlueSpace

BlueSpace is the name of an interpreter for the Whitespace programming language.

Whitespace

Whitespace is an esoteric programming language that was created by Edwin Brady and Chris Morris and is based at http://compsoc.dur.ac.uk/whitespace/. Its syntax consists entirely of characters that are usually invisible when displayed by a computer: space, horizontal tab and line feed.

BlueSpace

This interpreter is written in Python 3 and boasts the following features:

  • Interpret Whitespace code
  • Compile Whitespace code to Python and optionally execute it
    • Optimise the generated Python code
  • Accept and translate between Whitespace syntax, as well as:
    • A printable syntax, which substitutes space, tab and linefeed with s, t and n, respectively
    • An assembly-style syntax (described below)

To run a Whitespace program, simply execute ./bspace.py source.ws; to see other options, use ./bspace.py --help.

Assembly Syntax

Each line of the source must match one of the following forms, where number is any decimal integer and label is any string of s and t characters with an optional trailing n. Each line maps to a single Whitespace instruction. A # begins a comment; it and any subsequent characters on the same line are ignored.

Push number
Duplicate
Copy number
Swap
Discard
Slide number

Add
Subtract
Multiply
Divide
Modulo

Store
Retrieve

Label label
Call label
Jump label
JumpZero label
JumpNegative label
Return
End

OutputChar
OutputNum
ReadChar
ReadNum

More

I have another page about Whitespace and BlueSpace which includes some of my own Whitespace programs at http://cpjsmith.co.uk/whitespace

bluespace's People

Contributors

smithers888 avatar

Watchers

 avatar

Forkers

wspace

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.