Binerdy was created by user:Bas to reminiscence the old days, when computers only understood zeroes and ones. The name is a derivative of Binary and nerd, because programming in Binerdy is an art in itself.
A Binerdy program only knows of 2 valid instructions,
1. Other characters are invalid and will thus throw an error on execution. Instructions are interpreted as alternating
1's. Whenever 2 of the same instructions are entered, the program will count the alternating instructions preceding it and perform a command. It doesn't matter if you start your program with a
0 or a
0101011010011101011 will perform the instructions 6, 4, 2, 1, 5, 1
010101 1010 01 1 10101 1. Here, the non alternating characters have been seperated by a space for improved readability.
Because stacks should be clear after executing code to conserve all precious memory, Binerdy will bluntly dump all data still on the stack after execution.
Binerdy supports the following instructions:
||exit||Stop execution. Only happens when the program has a length of 0|
||init||Add 0 to the top of the stack.|
||inc||Increases the top stack value with 1, overflows to 0 at 256|
||dec||Decreases the top stack value with 1, overflows to 255 at -1|
||add||Removes the top stack value and add it to the second stack value. This will be the new top stack value|
||sub||Removes the top stack value and substract it from the second stack value. This will be the new top stack value|
||label||Removes the top stack value and turns it into a label|
||je||Removes the top stack value and stores it as label to jump to. Removes next top stack value and compares it to the stack value after that. If equals, jump to label|
||jne||Removes the top stack value and stores it as label to jump to. Removes next top stack value and compares it to the stack value after that. If not equals, jump to label|
||input||Stores user input at the top of the stack|
||swap||Swap the 2 top stack values|
||Read the top stack value, interpret it as character and print it|
||char||Read the top stack value and print it|
||rem||Remove the top stack value|
A cat program which executes a single time is implemented in the following:
An infinitely operating version is realized in
A truth-machine implementation is defined by
Common Lisp implementation of the Binerdy programming language.