From Esolang
Jump to navigation Jump to search

THRAT is a Brainfuck-derived esoteric programming language devised by Mate Varga in 2004. It uses two instructions to select from a table of ten operations, in the style of ReMorse.

Like Brainfuck, THRAT has a memory block (4096 bytes by default) and a memory pointer that points to a single byte in the block.

The ten operations are the eight from Brainfuck plus two more:

# Description
0 Halt program execution
1 Increment the memory cell under the pointer
2 Decrement the memory cell under the pointer
3 Move the pointer to the right
4 Move the pointer to the left
5 Jump past the matching 6 if the cell under the pointer is 0
6 Jump back to the matching 5
7 Output the value of the cell under the pointer as a number
8 Output the character signified by the cell at the pointer
9 Input a character and store it in the cell at the pointer

There is an operation pointer which points to a single operation (initially the first). The ; instruction increments the operation pointer by 1, and the : instruction executes the operation which is currently pointed at.

Computational class

The THRAT commands are a proper superset of Brainfuck's, with no special restriction on the execution of arbitrary commands at arbitrary points; the THRAT specification also does not preclude having an unbounded store (either a block of infinite size, or a block which grows when the bounds are exceeded.) So THRAT is in the same computational class as Brainfuck. Brainfuck is Turing-complete, so THRAT is Turing-complete as well.

See also

External resources