DROL

DROL (Double Register Optimization Language) is a simple single-character compiled language created by Bradley Sadowsky (User:BradleySadowsky). The compiler was released under the MIT License and written in Python 2.7.12. Everything in DROL is done by manipulating two virtual registers, Register One and Register two (somewhat similar to Deadfish). Each register has its own distinct set of commands. A key feature of DROL is its inability to handle errors: it simply ignores them (unless they pertain to loops or subroutines). DROL is currently on version 3.0.0.

Etymology of "DROL"
DROL (Double Register Optimization Language) refers to the existence of two registers, and the fact that it is a language. The optimization part of the acronym just sounded nice, as it is very far from an optimized way of doing things.

Python Implementation
Currently, this is the only implementation. Written in Python, it translates DROL source into C code. It assumes GCC on the host system, although that can be easily changed in the source.

Extension
Both loops and subroutines (and calls) require a small section at the beginning identifying their length known as the Optional Command Header. For example, in the following code

j != 0129 the not equal to comparison operator and the 4 digit number specifying how many commands are to be included in the loop would (!=0129) would be the Optional Command Header. However, for commands with longer Optional Command Headers, extended commands were added that essentially doubled the header (with the exception of if and while loops, which went from a 6 character long header to a 10 character long header). Here is a table of all the original commands and their extensions:

Loops
There are three types of loops in DROL: the If Loop, the While Loop, and the Forever Loop. The If Loop is used with the either standard J or the extended ". The if command is used as follows

j XX YYYY Where XX is either == (equal to), != (not equal to), >= (greater than or equal to), <= (less than or equal to), >> (greater than), or << (less than). YYYY is the amount of commands to be encompassed by the loop. The While Loop is used the same way, with the w and ' replacing j and ".

The forever loop (@, #) is unconditional, and simply repeats the commands forever. An example of the forever command is as follows:

@ 0003 which would be followed by three commands that would be repeated forever.

Subroutines
Subroutines in DROL take no arguments and return no value. They are declared with the : command or the extended (. Standard subroutines must have 4 character-long names, while extended subroutines must have 8 character-long names. An example subroutine named subr could be declared as follows:


 * 0056 subr

or alternatively it could be declared with the extended command as follows:

( 00000056 function which could be called as follows:

or (if it was an extended subroutine):
 * subr

) function

Simple Single Register Hello World
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiaziiiiiiiiiiiiiiiiiiiii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i<<aziii<<<i<<azi<<<<<ia!

Truth Machine
nj==0002oxkj==0006@0001o Which could be extended to the following

n        { Get user inputted number R1 } j == 0002 { Check if registers are equivalent, as R2 will be 0 } o      { If so, output R1, which will be 0 } x      { Exit program successfuly } k        { Increment R2 by 1 for the next comparison } j == 0006 { If R1 == R2 then R1 will be 1 } @ 0001 { Loop the next instruction infinitely } o    { Output R1, which will be 1 }