Copyright © 2006 Krzysztof Piecuch, Tomasz Jędrzejewski
Table of Contents
List of Tables
List of Examples
On 28 August 2006, a small group of young mathematics and programmers from Poland arrived to the Stanislaw Staszic High School in Lublin in order to share their knowledge and experience. Just before the meeting started, the talk about esoteric programming languages began. In the opinion of the participants many of them offered nothing more than crazy syntax. On the first lecture, two people, Krzysztof Piecuch and Tomasz Jędrzejewski, decided to create something new and brilliant - a new programming language based on an extraordinary idea of working. That's how the Revomer project started.
During the five days of meeting, in very strange conditions, the first interpreter and the project goals were born. Most of the work took place at night and early morning, on a laptop located in the gymnasium, and the first version of this reference manual was written on a toilet paper. On 1 September, at 10.04 AM we managed to run the program writing "HI UNIVERSE" for the first time.
The name of the language is the English word "Remover" written backwards. It illustrates the basic ideas of the project. They can be described in a short abbreviation IN-IG (Is Negative-Is Good). The structure of the language forces the programmer to use completely new point of view to many of seeming obvious syntax elements and programming practices. We hope our project will be an important milestone for the human IT knowledge, and that it will be bought by the well-known software company from Redmond to include in in its products.
Table of Contents
In this chapter we describe the basic concepts of the Revomer Programming Language.
The program shown below is also the first one run on the Revomer Interpreter. It writes the "HI UNIVERSE" text on a screen and stops its work.
Example 1.1. "HI UNIVERSE" program
almukantarat~ nope~ null% almukantarat~ come here $1, $1, $3 gifs 3~ hide $3 gifs 29~ hide $2 gifs 29~ hide $1 pos $0~ gifs 69~ pos $0~ gifs 83~ pos $0~ gifs 82~ pos $0~ gifs 69~ pos $0~ gifs 86~ pos $0~ gifs 73~ pos $0~ gifs 78~ pos $0~ gifs 85~ pos $0~ gifs 32~ pos $0~ gifs 73~ pos $0~ gifs 72~ hide $0 %
A more detailed explaination will be done later.
Detailed concepts of the Revomer are:
The environment, where the Revomer programs are executed, consists of the following elements:
Table of Contents
Let's go back to the "HI UNIVERSE" program. We are going to introduce the language, basing on it..
Example 2.1. "HI UNIVERSE" program
almukantarat~ nope~ null% almukantarat~ come here $1, $1, $3 gifs 3~ hide $3 gifs 29~ hide $2 gifs 29~ hide $1 pos $0~ gifs 69~ pos $0~ gifs 83~ pos $0~ gifs 82~ pos $0~ gifs 69~ pos $0~ gifs 86~ pos $0~ gifs 73~ pos $0~ gifs 78~ pos $0~ gifs 85~ pos $0~ gifs 32~ pos $0~ gifs 73~ pos $0~ gifs 72~ hide $0 %
The first and most important rule that you need to learn, is the direction of program execution. Each line contains only one command. The lines are counted from the beginning of the file, but the code is executed from the end (from bottom to top). While describing the commands, we will use the terms "next command" and "previous command" according to the execution direction. Thus, the expression "to delete the next instruction" means the interpreter must delete the instruction that will be executed next, one line higher.
The source code consists of functions. The function declaration begins with the % character, BEFORE which
its name is specified. A function without the name is called main function, and it is called on the beginning of the program. Many
functions with the same name are allowed - while calling one of them is selected in a random way. The function ends its work, when
it reaches the next function declaration or the almukantarat command, and then makes sure it does not contain
any commands. Otherwise, it starts its execution again. The program ends at the moment of removing the last line from the used main
function.
As we said, the function may end, when reaches the next function declaration or the end of the command list. However, the interpreter
does not like, if the programmer wants him to go there - the execution should be terminated with the almukantarat command then
(Notice: this command is not counted in the total number of commands in the function), or the program is punished by executing
rope (random operation). To sum up, we have two commands in some function:
nope and almukantarat. As we said, the second one is not counted, so for the interpreter
this function contains only one command. If we delete just nope, the function terminates.
Some other syntax rules:
This chapter describes the command connected with creating, calling and managing functions.
name%
Begins a function with the specified name. If the name is not specified, the main function is created. If the interpreter reaches this line during the exection, it works like almukantarat, but before that the rope command is executed.
This command is not ended with a tilde.
almukantarat~
If the currently executed function has no commands, it is terminated and the program returns to the line, where the function was called. Otherwise, the function is executed again. The name of this command means "Almucantar" in Polish, which is an astronomy term (a circle on the celestial sphere parallel to the horizon).
conffunction1,function2~
Replaces two functions with the names. The operation affects also the functions that are already in the stack. The command is ended with a tilde.
rf function~
Removes from the code all the functions with the specified name. If we try to remove the main function, it does not stop the program! If the program does not have any main function, the interpreter starts to repeat the rope operation, hoping that one day it will manage to recreate the main function. The command is ended with a tilde.
charm $1
Calls the function. The function name must be put lowering into the memory cells, starting from $1. The only parameter is the address of the cell that contains the first letter of the name. The algorithm that reads the function name:
If the interpreter reaches the end of the memory, it performs the rope operation.
Example 2.3. Calling the "foo" function
almukantarat~ nope~ foo% almukantarat~ charm $2 gifs 111~ hide $0 gifs 111~ hide $1 gifs 102~ hide $2 %
This chapter describes the operators available in Revomer.
????&$1,$2
The Revomer Logic Operator performs the operation on the $1 and $2 parameters
and saves the result to the first one. The logical table:
The values other than Revomeric True and False are reducted to them with the Standard Reductor..
in $1
The IN Reductor - if there is a negative value in the specified memory cell, it saves there the Revomeric True (-1). For positive values - Revomeric False (0).
@&%^"$1,$2
Substracts the second parameter from the first and saves the result in the memory cell specified in the second one.
*?!$1,$2
Divides the first parameter by the second and saves the result in the memory cell specified in the first one. When division by 0 occurs, it performs rope.
~].?&*$1,$2~
Copies the content of the first cell to the second. In the example below, we first insert the value 52 to the
$8 cell and then copy it to $9.
Example 2.4. Copying
almukantarat~ nope~ null% almukantarat~ come here $0, $0, $1 gifs 3~ hide $1 gifs 8~ hide $0 pos $9~ ~].?&* $8, $9~ gifs 66~ hide $8 %
The command must be ended with a tilde..
This chapter describes the commands that allow the source code management.
come here$1[,$2[,$3]]
Moves the parts of the source code from one place to another. The exact action depends on the number of parameters:
$1 and moves it before the "come here".$2 lines
to the top (the end of the selected area). The group is moved right before the come here.come here
(line numbers counted from the top).Warning: if the new localization of a command group is inside ythis group, it causes
the defragmentation of the source code! The behaviour of the command cursor is the following: by default, the next
command to execute lies after come here. However, if come here moves
also itself, we jump to the command after the moved group.
unless}$1#
The conditional code removing. If there is a Revomeric False in the specified memory cell, the next command in the source code is removed. The memory cell address is typed inside brackets.
if$1,$2~
Includes the Revomer file, whose name is specified between the memory cells $1 and $2. The
contents of the file are included in the place of the if command, which is removed. The execution
starts from the line-before-the-last in the included file.
shuffle$1,$2
Shuffles the source code between the lines $1 and
$2 to the top. An example: random numbers from 1 to 10.
Example 2.5. Random numbers
almukantarat~ nope~ null% almukantarat~ come here $2, $2, $4 gifs 3~ hide $4 gifs 21~ hide $2 pos $0~ gifs 74~ gifs 73~ gifs 72~ gifs 71~ gifs 70~ gifs 69~ gifs 68~ gifs 67~ gifs 66~ gifs 65~ shuffle $1, $2 hide $0 gifs 1~ hide $1 gifs 11~ hide $2 %
In the example, we chose to mix the lines from 1 to 11 above the shuffle.
This chapter describes the memory management commands.
hide $1
Moves the interpreter pointer to the specified memory cell. We do not write a tilde after it.
gifs value~
Puts the specified positive number to the memory cell pointed by the interpreter pointer. The code
below puts the number "20" to the memory cell $0:
sars 1|2|4
Changes the length of the parameters passed to commands. The acceptable lengths are
1, 2 or 4 bytes. Moreover, the call of sars changes the endianess.
The memory pointers always point the highest byte.If the interpreter works in
big endian, the rest of the bytes is read from the cells with
incrementing number. For little endian - the addresses
decrement.
Input/output commands.
gifts$1[,$2]
The input command, writes the entered character/number to the specified memory cell. Depending on the second parameter:
Additional commands that need special attention.
rope~
Performs a random operation with random arguments. rope is
really important for the Revomer Programming Language, because it allows to guess,
what the programmer wanted to do, for example by making a syntax error. So, rope
is called after every unexpected situation. It is the only command that can, but
does not have to be ended with a tilde.
rope can also generate functions. If the main function is
generated, and there is no main function in the code, the interpreter jumps to this
function.
Some additional information about the memory and storing data in Revomer.
This chapter describes the logical system used by Revomer. It is very similar to the classical model, but there are some important details which should be kept in mind.
The Revomer Logic uses two logical values: Revomeric False (0) and Revomeric True (-1), which has a negative value.
The Revomer Logic has only one logical operator: ????& and two reductors that allow to convert any other value to the Revomeric True or False. The operator ????& gives the following result:
It is similar to the NAND operator in the classical logic.
The Standard Reductor is used by default to conversion to the logical values. Here is its algorithm:
The second reductor is called IN (Is Negative). It converts all the negative numbers to the Revomeric True and the rest to the Revomeric False.
Some tips, how the intepreter should work.
That's not all! In the future versions, the Revomer Programming Language will have a lot of new features:
The changes will be compatible with the reference you have already read.
For those who do not know Polish, we translated also a part of the Ferrinti language grammar concerning numbers.
Table A.1. The base numbers
| Number | Cardinal | Ordinal | Number name |
|---|---|---|---|
| 0 | nŭl | queril | nŭl |
| 1 | quanta | quantil | quatte |
| 2 | dwa | dual | dutte |
| 3 | thri | tril | dutte |
| 4 | varta | varial | varte |
| 5 | pest | pestal | pette |
| 6 | sekt | sektal | sĕkte |
| 7 | sevain | sevil | sevte |
| 8 | erven | ervil | erve |
| 9 | nŭna | nŭnil | nŭtte |
| 10 | tæn | tænil | tætte |
| 11 | elvain | elvain | elvatte |
| 12 | dheza | dhezin | dette |
| 100 | centein | centil | centrĕ |
| 1000 | tuzen | tuzal | - |
| 1000000 | million | millial | - |
| 1000000000 | milliard | mirdial | - |
Creating compound numbers:
And so on to billions.
For Revomer, use "e" for "ĕ", "u" for "ŭ" and "ae" for "æ"