Nameless language
- Not to be confused with TLWNN.
Paradigm(s) | imperative |
---|---|
Designed by | |
Appeared in | 2012 |
Memory system | Category:cell-based |
Dimensions | one-dimensional |
Computational class | Turing complete |
Reference implementation | nameless-lang |
Influenced by | Brainfuck |
File extension(s) |
The nameless language is an esoteric programming language which only uses the digits 1 and 0 in its source code, making it look like binary. It is based on brainfuck, but adds five additional commands, making it slightly easier for the programmer to perform common tasks.
Language overview
Nameless language operates on an array of memory cells called a tape. There is a virtual pointer which starts off pointing to the first memory cell. Each of nameless language's commands are four digits long and are only made up of ones and zeros. The commands are:
Command | Description |
---|---|
0000
|
Move the pointer to the right |
0001
|
Move the pointer to the left |
0010
|
Increment the memory cell under the pointer |
0011
|
Decrement the memory cell under the pointer |
0100
|
Output the character signified by the cell at the pointer |
0101
|
Input a character and store it in the cell at the pointer |
0110
|
Jump past the matching 0111 if the cell under the pointer is 0
|
0111
|
Jump back to the matching 0110 if the cell under the pointer is nonzero
|
1000
|
Add the next command's base 10 equivalent to the current cell |
1001
|
Subtract the next command's base 10 equivalent to the current cell |
1010
|
Randomly sets the current cell's value to either 1 or 0 |
1011
|
Reset the current cell's value to 0 |
1100
|
Reset the pointer to point at cell 0 |
The nameless language interpreter ignores any characters which are not a one or a zero so you can type comments and they won't have any effect on the program. It is worth noting that the command 0001
which moves the pointer to the left, will wrap around to the last cell if it is called when the pointer is over the left most cell of the tape.
Example code
An example "Hello, World!" program written in nameless language:
00100110001100110000001101100000000000100000001100110011001100110001000101110001 00110011000100110011001101110000001101000000000000000010010000000000010001000010 00100010011001000000011100010001000100010100001000100010010000110011001100110011 001101000001000100110100000000000000000000100100
An example cat program which asks for five letters of input and then outputs them again:
0101000001010000010100000101000001011100010000000100000001000000010000000100
References
- Nameless language on the Nameless Wiki (from the Wayback Machine; retrieved on 14 January 2012)
- JavaScript interpreter (from the Wayback Machine; retrieved on 28 April 2012)