Niblet

niblet is an esoteric programming language where nibbles are used to store data.

The project can be found on GitHub.

Cells and the stack
Similar to brainfuck, niblet gives the programmer 30,000 cells to store data. There are a few ways data can be stored into the cell at the cell pointer:


 * putting using the Put token
 * merging using the Put token as well
 * input from the user using the Input token

Putting the stack in a cell, while the stack is a nibble, will be stored as a byte with four trailing zeros. For example, putting 1100 will be stored as 11000000.

Merging will perform the Bitwise OR operation on the current cell, which has four trailing zeros, with the stack, which has four leading zeros. For example, merging 11000000 (the current cell) and 1010 (the stack) will result in the current cell's value to be 11001010.

Once putting or merging has been completed, the Bitwise NOT operation will be performed on the stack. For example, after putting or merging a stack with the value of 1010, the stack will have the value of 0101.

If a cell has already been merged, the Put token will clear the current cell's value and put the stack rather than merging.

The Output token will print the value of the current cell as the character it represents.

Controlling pointers
Each time a command is run, the cell pointer is incremented by 1. The Back token may be used to return to the previous token, since it moves the cell pointer back twice.

Unlike other tokens, if a Back-source token is found by the interpreter, each proceeding Back-source token will be executed then skipped. This allows the creation of a loop using the Check token to go back multiple tokens.

Cat
,<.<[[[[

Hello World
++++<<<<v< ---<<<v<. -<v< <<<<v<. <<<<<v< +++<<<v<. +++<<<v< +++<<<v<. +++<<<v< ++++++<<<<<<v<. ++<<v< -<v<. -<v< -<<<<<<<<<<<<<v<. --<<<<<<<<<<v< ---<<<v<. --<<v< ++++++<<<<<<v<. +++++++<<<<<<<v< --<<<<<<v<. ---<<<<<<<v< +++<<<v<. +++<<<v< -<<<<<v<. -<<<<<<<<<v< <<<<<<<<<<<<v<.