View on GitHub

Morse

what if morse code became a programming language?

Download this project as a .zip file Download this project as a tar.gz file

Morse

An estoric programming language consisting of only . and _.

Example

The following program takes the input of two numbers from the user and adds them. It asks for the input again in case the result is zero.

____
____
_...
_....
__._
_._.. _

Build

Download the source code and build it by running:

make

Usage

You can run your programs by:

./morse [filename]

Syntax

The execution environment maintains only 2 stacks, one for integers and other for characters.

Stack Manipulation

Operations on the integer stack:

Operations on the character stack:

Arithmetic Operations

Input/Output

Flow Control

Representing literals

Numbers can be represented in their binary form, with the 0s being . and 1s being _. Characters can be represented as the corresponding binary format of their ASCII code.

Note: You can only represent positive integers right now.

For example:

License

MIT

Contact

This was made out of sheer joblessness by Sankha. Follow him @sankha93 on Twitter.