Revomer

From Esolang
Jump to navigation Jump to search

Revomer is an esoteric programming language where the programs work by removing the lines of their own source code. It was created by Tomasz "Zyx" Jedrzejewski (User:Zyx) and Krzysztof Piecuch in the summer Category:2006.

Short description

The name Revomer is the English word "remover" written backwards. Combined with the rule IN-IS (Is Negative - Is Good), we get all the basic ideas of the project:

  1. Generally speaking, removal, negation, substraction (and even division!) are good. Addition and the rest are baad.
  2. If we manage to add something, this always costs something, because it is baad.
  3. The execution of the program is based on self-modification of the source code.
  4. If the interpreter does not know what to do, it tries to guess what the programmer wanted (read: performs a random operation).

History

On 28 August 2006 the project authors came to the summer science camp of the city of Lublin in Poland. The talk after the arrival delved into esoteric programming languages, and they decided to create their own. For five days, under strange conditions, they created the language itself and began to write the interpreter. It is worth mentioning that the first reference manual was written on toilet paper, which is currently kept by Zyx in an honourable place.

Features

  • Functions (with function management)
  • Pointers
  • Input/output commands
  • Code management
  • Mathematical operators
  • Revomer Logic Model

Syntax

Revomer has a very strict syntax, which resembles Assembler somewhat. There are no comments, and whitespace is allowed only at the end of a line. Each line contains one command and its parameters. The program is executed from bottom to top.

The syntax rules are:

  • Every command must end with a tilde, except those commands that must not. The exception from the exception is the rope command, which works both with a tilde and without it.
  • There are no comments, because the interpreter does not like it when someone comments its work. Moreover, you are only free to use whitespace at the end of a line.
  • The parameters are separated with commas and are usually pointers to memory cells containing actual values.
  • Some commands use brackets. The opening bracket is } and the enclosing bracket is #.

Functions

A program in Revomer consists of functions, which have a name. The language accepts the situation when many functions share the same name. The interpreter should then run a random one whenever the program wants to call one of them. A function begins with a declaration:

functionname%

and ends with

almukantarat~

A function is executed until its source code, between the declaration and almukantarat, is removed. The program stops when the main function's source code is removed.

General issues

  1. The program can use a 64-kb memory divided into 1-byte cells. The command parameters are usually pointers to the memory cells that contain the exact values. It is possible to read and write longer (2- and 4-byte) values.
  2. Revomer uses its own Revomer Logic System, where false is 0 and true is -1. There is only one operator, similar to NAND, and two reductors, which convert other values to true or false.

Commands

The following commands are available in the language:

  1. conf – replaces two functions with a name.
  2. rf – removes a function (but does not cause it to stop :)).
  3. charm – calls a function.
  4. unless – conditional code removal. If the value in the specified memory cell contains 0, removes the next command to execute.
  5. come here – allows moving parts of the source code from place to place.
  6. if – includes a file and removes itself from the source.
  7. real – removes the specified code line.
  8. shuffle – shuffles the specified part of the source code.
  9. hide and gifs – are used to put constant values in the memory.
  10. gifts – input command: reads an ASCII character or a typed number from the input.
  11. pos – output command: prints an ASCII character on the screen.
  12. sars – changes the length of the parameters passed to commands (allowed lengths: 1, 2 or 4 bytes). Moreover, changes endianness every time it is called.
  13. nope – does nothing.
  14. rope – performs a random operation. This is a very important operation, because it handles every unexpected situation.

Operators

  1. ????& – the only operator in the Revomer Logic System (similar to NAND)
  2. inIs Negative - the optional Revomer Logic Reductor, returning -1 for negative numbers and 0 for 0 and positive numbers
  3. @&%^" – subtraction
  4. *?! – division
  5. ~].?&* – copying

Sample programs

Here is a simple program that prints HI UNIVERSE on the screen:

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 program below does multiplication, but currently it is a bit tricky, because it uses the illegal num operation to print the result on the screen. The problem was that the number printing requires multiplication and to test the multiplication, we needed num :). In the near future the listing will be updated.

almukantarat~
mul_null%
almukantarat~
conf mul_null, n~
unless}$506#
????& $506, $507
in $507
in $506
@&%^" $508, $506
conf n, mul_null~
@&%^" $501, $508
@&%^" $501, $507
gifs 1~
hide $508
gifs 1~
hide $507
gifs 1~
hide $506
~].?&* $505, $503~
~].?&* $503, $504~
@&%^" $504, $503
~].?&* $503, $505~
~].?&* $505, $502~
~].?&* $502, $501~
@&%^" $501, $502
~].?&* $502, $505~
n%
almukantarat~
nope~
nope~
nope~
nope~
foo%
almukantarat~
come here $520, $521, $522
gifs 3~
hide $522
gifs 17~
hide $521
gifs 17~
hide $520
charm $66
gifs 110~
hide $66
gifs 0~
hide $504
@&%^" $509, $503
~].?&* $500, $503~
gifs 1~
hide $502
gifs 0~
hide $509
m%
almukantarat~
come here $500, $501, $502
gifs 3~
hide $502
gifs 14~
hide $501
gifs 14~
hide $500
num $504
charm $66
gifs 109~
hide $66
gifs 8~
hide $501
gifs 8~
hide $500
%

Turing-completeness

Except for memory limits, the language is believed to be Turing-complete, but this has not been proved yet.

Future versions

The next version of the language is being developed. It will be compatible with the first release, but will have many more features:

  1. Filesystem support
  2. Network Source Code Transmission Protocol
  3. System console support - the programs will be able to have a simple interface
  4. Multiexceptioning - a revolutionary connection of multitasking and exceptions
  5. Elements of RPG
  6. Standard Useless Function Library
  7. Memory management

External resources