ROOP

ROOP (Real Object-Oriented Paradigm) is a two-dimensional language created by User:-Dark-Phantom- on December, 2015. The language uses a rectangular grid of objects represented as characters in the source code. Some objects are static and others can move.

Grid
In each slot of the grid can be only one object, or be empty.

The width of the grid is determined by the line of code with more characters. Lines with fewer characters are filled with empty spaces on the right.

The grid is implicitly surrounded by blocks. The following code: 2A3 becomes:
 * 1) 2A3#
 * 1) 2A3#

Note: The above example had no spaces under the characters, there was just one newline character after. This creates a line of empty spaces.

Objects
The objects are divided into a few categories: Data, Operators, Pipes, Block. In turn, the operators are divided between Normal Operators and Special Operators.

Data
Objects of this type can contain one of the following four types of data: signed integer, string, input, output. They also have a direction of movement: left or right (starting to the right). And they also have gravity, so if there is a space below, will fall.

Their position is updated in phase two of each update.

They can be empty or not empty. It is considered an empty object to an integer equal to zero and a string without characters. Are considered non-empty objects nonzero integers, strings with at least one character, input and output.

Normal Operators
Operators run on the phase one of each update.

Operators get several objects from up, left or right and create a new object with the result. Some operate separately on each axis (grab an object above and put the result below, take an object on the left and put the result on the right).

Except some special cases, operators have two versions. In uppercase mark the objects to disappear for the next update. In lowercase do not.

If the operator attempts to use objects with wrong types or the result could not be delivered, then the operation is considered failed and objects are left unchanged.

The created objects can be placed in an empty space or in a pipe.

In the table below you can see every normal operator with the kind of object that needs at each place and a description of what it does. Those who say mixed means that they can be numbers or strings. Those who say "any" means that it can be any type of data.

Special Operators
Special operators work like normal operators but also can receive objects from the pipes.

Pipes
The pipes are objects in which data objects can travel. The whole trip is made in the same update, sending objects up to a special operator. If the object can not be delivered, then the operator that put the object in the pipe fails.

Creating an infinite loop is undefined behavior. The interpreter is not required to detect it and can stay in an infinite loop or produce a stack overflow.

The direction in which the objects move depends on the pipe and operator rather than the direction in which the objects points. Objects created under an operator will go down. Objects created on the right will go to the right.

Block
It is the  character. It does nothing.

Updates
Each update is divided into two phases. After the two, the current tick is increased by one.

Phase one
Operators are updated one by one, starting at the top left, line by line. Objects created by the operators do not appear in the grid until the phase is not over. The objects can only be created in areas that are now empty and that no other operator used in this phase.

The objects used do not appear in the next phase if at least one of the operators put them to removal (normally uppercase versions).

In this same phase it is where the objects run through the pipes.

If there is no object at the end of the phase, the program ends.

Phase two
The positions of the objects are updated one by one, starting at the top left, line by line. Each object tries first to go down, if it can not then try to go in the direction where it points.

All positions are updated at the same time, those who go down have priority over those who go to the right, which have priority over those who go to the left. Here's an example: Assuming that the odd numbers point to the right and even numbers to the left:
 * 1) 1 2#12#
 * 2)   #1##
 * 3) 1 #3##
 * 4) 3 2#5 #
 * 5) 1 9  #
 * 6) 35735 #
 * 1) 1 9  #
 * 2) 35735 #
 * 1) 35735 #
 * 1) 12#12#
 * 2)   #1##
 * 3) 312#35#
 * 4)  1   #
 * 5) 357935#
 * 1) 312#35#
 * 2)  1   #
 * 3) 357935#
 * 1) 357935#

Literals
When the source code is converted, the literals are replaced by objects. There are single character literals and multiple characters.

Single character
The digits ( to  ) are individually replaced by a numeric object containing that value.

The character  is replaced by the input object.

The character  is replaced by the output object.

Multiple character
They can be horizontal or vertical. All the characters are replaced by empty spaces except for the first (top left) which is replaced by the object with the corresponding value.

Examples of literals
(-123)         '           /dd/ [              a           \ 4              b           l         {This is a comment} 5            "zcy\""       l 6               d           \ ]               ' The first object contains the number  . The second object contains the number  . The third object contains the string  . The fourth object contains the string   (Note that the second character was replaced by a space by the previous literal). The fifth object contains the string  . The sixth object contains the string.

Hello, World!
"Hello, World!" h

Cat
Infinite I W O

Infinite Loop
1

Truth-machine
I wX nw hO

Is prime
I w#H P  w   O

Quine
It has a trailing newline character "##V ---V\n  ---%\n     V-< -V\n/92/   | |\nA/110/X| |\n|/10/d-< |\n||--->   |\n|V /10/A |\n|  ####  |\nV X    # |\n a /34/A |\n#  v###  |vH\n  X X    | #\n W W   V |W\n O#O#  --  | |V /10/A | | ####  | V X    # | a /34/A | X X   | # W W  V |W O#O# --<O# # #     #
 * 1) V ---V
 * 1)  v###  |vH

Computational class
ROOP is turing complete, as it is possible to translate any brainfuck code to it, using the following table. Each section of code goes under the previous. Use a stack with cells of 7 bits, unsigned and without wrapping.

Implementation
C++ Implementation in GitHub

Online interpreter