Malbolge

Malbolge is a public domain esoteric programming language that was developed in 1998 by Ben Olmstead. It was named after the eighth circle of hell in Dante's Divina Commedia.

The peculiarity of Malbolge is that it was developed as a worst programming language which is the hardest to use. However Malbolge is only slightly different processing rules Turing complete because of the limited memory.

General

As evidence of the difficult development of programs is that the first Malbolge program is only made ​​two years after the emergence of the language. This program has not been programmed by a human, but found by a written in Lisp program using a search algorithm. Developed this search program by Andrew Cooke.

There are several reasons that Malbolge is so difficult. The most important is that commands are replaced after their execution by other commands. This makes it very complicated to implement loops in Malbolge. Other factors that complicate programming in Malbolge, include the fact that the manipulation of data words only in the ternary number system by right- shifts and a very unusual operator is possible. In addition, the coding of a command, the memory cells can only be initialized to one of eight possible values ​​depending ASCII by an ASCII character from the position command and the modulo 94.

Nevertheless, we succeeded Lou Scheffer, to develop a program that his one- on copies its output. His report concludes with proposals about how the language would make it more difficult to control.

Basic operation of Malbolge

Malbolge owns the three registers a, c and d, and a memory size that can store a 10-digit ternary integer in each cell.

Initialization

The source code is first filtered, read without spaces or newline characters into the memory size. The remaining free disk space is then encoded with the Crazy function: [m ] = crz ( [m - 2], [ m - 1 ] )

Instruction set

Malbolge has 8 instruction words. The current statement is determined by the contents of [ c] and c is then calculated and added modulo 94. The result is then compared with the following values ​​:

After each operation [c ] is encrypted. Then c and d increases by one.

Crazy function

The two above given numbers are one digit at a encoded according to the table. For example, from crz 0001112220, 0120120120, the number 1,001,022,211th

Encoding

After you execute the statement, but before the increment of c, is permuted using a code table [c ].

Hello, world

This Malbolge program is "Hello, world. " from.

( = < `: 9876Z4321UT. -Q * ) M '& $ % H" ~ } | BZY = | { z] KwZY44Eq0 / { mlk **?   hKs_dG5 [ m_BA {? - Y;; Vb'rR5431M } / zHGwEDCBA @ 98 \ 6543W10/.R, O <. Other programs in Malbolge

It is now no longer a problem to write programs in Malbolge who spend only a fixed string of limited length. The string length is limited because Malbolgeprogramme can not contain more than 59049 commands.

In addition to the above mentioned cat- program of Lou Scheffer (which exploits a bug in the interpreter, which allows memory cells to initialize with non-ASCII characters), there has been (as of December 2012) very few programs in Malbolge, the loops included. One of them is another cat program, which, however, works even without use of the interpreter bugs. Among the most impressive programs in Malbolge likely a 2005 published program include that prints the lyrics of the song " 99 Bottles of Beer " and used for non-trivial loops and conditional branches. The code of this program is not readable for a human. Another program in Malbolge that works with non-trivial loops and conditional branches, is a book published in late 2012 Quine.

Popular culture

  • In the tenth episode of the television series Elementary, Leviathan, it is, a determination notice was written in Malbolge.
541836
de