Malbolge
   HOME

TheInfoList



OR:

Malbolge () is a
public domain The public domain (PD) consists of all the creative work A creative work is a manifestation of creative effort including fine artwork (sculpture, paintings, drawing, sketching, performance art), dance, writing (literature), filmmaking, ...
esoteric programming language An esoteric programming language (sometimes shortened to esolang) is a programming language designed to test the boundaries of computer programming language design, as a proof of concept, as software art, as a hacking interface to another language ...
invented by Ben Olmstead in 1998, named after the eighth circle of hell in
Dante Dante Alighieri (; – 14 September 1321), probably baptized Durante di Alighiero degli Alighieri and often referred to as Dante (, ), was an Italian poet, writer and philosopher. His ''Divine Comedy'', originally called (modern Italian: '' ...
's ''
Inferno Inferno may refer to: * Hell, an afterlife place of suffering * Conflagration, a large uncontrolled fire Film * ''L'Inferno'', a 1911 Italian film * Inferno (1953 film), ''Inferno'' (1953 film), a film noir by Roy Ward Baker * Inferno (1973 fi ...
'', the
Malebolge In Dante Alighieri's '' Inferno'', part of the '' Divine Comedy'', Malebolge () is the eighth circle of Hell. Roughly translated from Italian, Malebolge means "evil ditches". Malebolge is a large, funnel-shaped cavern, itself divided into ten ...
. It was specifically designed to be almost impossible to use, via a counter-intuitive 'crazy operation', base-three arithmetic, and self-altering code. It builds on the difficulty of earlier challenging esoteric languages (such as
Brainfuck Brainfuck is an esoteric programming language created in 1993 by Urban Müller. Notable for its extreme minimalism, the language consists of only eight simple commands, a data pointer and an instruction pointer. While it is fully Turing com ...
and
Befunge Befunge is a two-dimensional stack-based, reflective, esoteric programming language. It differs from conventional languages in that programs are arranged on a two-dimensional grid. "Arrow" instructions direct the control flow to the left, righ ...
), but takes this aspect to the extreme, playing on the entangled histories of
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
and
encryption In cryptography, encryption is the process of encoding information. This process converts the original representation of the information, known as plaintext, into an alternative form known as ciphertext. Ideally, only authorized parties can decip ...
. Despite this design, it is possible to write useful Malbolge programs.


Programming in Malbolge

Malbolge was very difficult to understand when it arrived. It took two years for the first Malbolge program to appear. The author himself has never written a Malbolge program. The first program was not written by a human being; it was generated by a
beam search In computer science, beam search is a heuristic search algorithm that explores a graph by expanding the most promising node in a limited set. Beam search is an optimization of best-first search that reduces its memory requirements. Best-first se ...
algorithm designed by Andrew Cooke and implemented in
Lisp A lisp is a speech impairment in which a person misarticulates sibilants (, , , , , , , ). These misarticulations often result in unclear speech. Types * A frontal lisp occurs when the tongue is placed anterior to the target. Interdental lisping ...
. Later, Lou Scheffer posted a
cryptanalysis Cryptanalysis (from the Greek ''kryptós'', "hidden", and ''analýein'', "to analyze") refers to the process of analyzing information systems in order to understand hidden aspects of the systems. Cryptanalysis is used to breach cryptographic sec ...
of Malbolge and provided a program to copy its input to its output. He also saved the original interpreter and specification after the original site stopped functioning, and offered a general strategy of writing programs in Malbolge as well as some thoughts on its
Turing completeness In computability theory, a system of data-manipulation rules (such as a computer's instruction set, a programming language, or a cellular automaton) is said to be Turing-complete or computationally universal if it can be used to simulate any Tur ...
. Olmstead believed Malbolge to be a
linear bounded automaton In computer science, a linear bounded automaton (plural linear bounded automata, abbreviated LBA) is a restricted form of Turing machine. Operation A linear bounded automaton is a nondeterministic Turing machine that satisfies the following thre ...
. There is a discussion about whether one can implement sensible loops in Malbolge—it took many years before the first non-terminating one was introduced. A correct 99 Bottles of Beer program, which deals with non-trivial loops and conditions, was not announced for seven years; the first correct one was by Hisashi Iizawa in 2005. Hisashi Iizawa et al. also proposed a guide for programming in Malbolge for the purpose of obfuscation for software protection. In 2020,
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continuous ...
user ''kspalaiologos'' made a working
Lisp A lisp is a speech impairment in which a person misarticulates sibilants (, , , , , , , ). These misarticulations often result in unclear speech. Types * A frontal lisp occurs when the tongue is placed anterior to the target. Interdental lisping ...
interpreter in Malbolge Unshackled.


Example programs


Hello, World!

This program displays " Hello, World.".
(=<`#9]~6ZY327Uv4-QsqpMn&+Ij"'E%e, REokN:#?G"i@5z]&gqtyfr$(we4{WP)H-Zn, \3dL+Q;>U!pJS72FhOA1CB6v^=I_0/8, jsb


; Method 2: Find the result below. Store the encrypted version at ''[c'.

{,  style="margin:auto;" class="wikitable"
, + Encryption table
, - style="text-align:center;"
! Result !! Encrypted !! Result !! Encrypted !! Result !! Encrypted !! Result !! Encrypted !! Result !! Encrypted
, - style="text-align:center;"
,  0 , ,  57 , ,  19 , ,  108 , ,  38 , ,  113 , ,  57 , ,  91 , ,  76 , ,  79
, - style="text-align:center;"
,  1 , ,  109 , ,  20 , ,  125 , ,  39 , ,  116 , ,  58 , ,  37 , ,  77 , ,  65
, - style="text-align:center;"
,  2 , ,  60 , ,  21 , ,  82 , ,  40 , ,  121 , ,  59 , ,  92 , ,  78 , ,  49
, - style="text-align:center;"
,  3 , ,  46 , ,  22 , ,  69 , ,  41 , ,  102 , ,  60 , ,  51 , ,  79 , ,  67
, - style="text-align:center;"
,  4 , ,  84 , ,  23 , ,  111 , ,  42 , ,  114 , ,  61 , ,  100 , ,  80 , ,  66
, - style="text-align:center;"
,  5 , ,  86 , ,  24 , ,  107 , ,  43 , ,  36 , ,  62 , ,  76 , ,  81 , ,  54
, - style="text-align:center;"
,  6 , ,  97 , ,  25 , ,  78 , ,  44 , ,  40 , ,  63 , ,  43 , ,  82 , ,  118
, - style="text-align:center;"
,  7 , ,  99 , ,  26 , ,  58 , ,  45 , ,  119 , ,  64 , ,  81 , ,  83 , ,  94
, - style="text-align:center;"
,  8 , ,  96 , ,  27 , ,  35 , ,  46 , ,  101 , ,  65 , ,  59 , ,  84 , ,  61
, - style="text-align:center;"
,  9 , ,  117 , ,  28 , ,  63 , ,  47 , ,  52 , ,  66 , ,  62 , ,  85 , ,  73
, - style="text-align:center;"
,  10 , ,  89 , ,  29 , ,  71 , ,  48 , ,  123 , ,  67 , ,  85 , ,  86 , ,  95
, - style="text-align:center;"
,  11 , ,  42 , ,  30 , ,  34 , ,  49 , ,  87 , ,  68 , ,  33 , ,  87 , ,  48
, - style="text-align:center;"
,  12 , ,  77 , ,  31 , ,  105 , ,  50 , ,  80 , ,  69 , ,  112 , ,  88 , ,  47
, - style="text-align:center;"
,  13 , ,  75 , ,  32 , ,  64 , ,  51 , ,  41 , ,  70 , ,  74 , ,  89 , ,  56
, - style="text-align:center;"
,  14 , ,  39 , ,  33 , ,  53 , ,  52 , ,  72 , ,  71 , ,  83 , ,  90 , ,  124
, - style="text-align:center;"
,  15 , ,  88 , ,  34 , ,  122 , ,  53 , ,  45 , ,  72 , ,  55 , ,  91 , ,  106
, - style="text-align:center;"
,  16 , ,  126 , ,  35 , ,  93 , ,  54 , ,  90 , ,  73 , ,  50 , ,  92 , ,  115
, - style="text-align:center;"
,  17 , ,  120 , ,  36 , ,  38 , ,  55 , ,  110 , ,  74 , ,  70 , ,  93 , ,  98
, - style="text-align:center;"
,  18 , ,  68 , ,  37 , ,  103 , ,  56 , ,  44 , ,  75 , ,  104


Lou Scheffer's cryptanalysis of Malbolge mentions six different cycles in the permutation. They are listed here:

* 33 ⇒ 53 ⇒ 45 ⇒ 119 ⇒ 78 ⇒ 49 ⇒ 87 ⇒ 48 ⇒ 123 ⇒ 71 ⇒ 83 ⇒ 94 ⇒ 57 ⇒ 91 ⇒ 106 ⇒ 77 ⇒ 65 ⇒ 59 ⇒ 92 ⇒ 115 ⇒ 82 ⇒ 118 ⇒ 107 ⇒ 75 ⇒ 104 ⇒ 89 ⇒ 56 ⇒ 44 ⇒ 40 ⇒ 121 ⇒ 35 ⇒ 93 ⇒ 98 ⇒ 84 ⇒ 61 ⇒ 100 ⇒ 97 ⇒ 46 ⇒ 101 ⇒ 99 ⇒ 86 ⇒ 95 ⇒ 109 ⇒ 88 ⇒ 47 ⇒ 52 ⇒ 72 ⇒ 55 ⇒ 110 ⇒ 126 ⇒ 64 ⇒ 81 ⇒ 54 ⇒ 90 ⇒ 124 ⇒ 34 ⇒ 122 ⇒ 63 ⇒ 43 ⇒ 36 ⇒ 38 ⇒ 113 ⇒ 108 ⇒ 39 ⇒ 116 ⇒ 69 ⇒ 112 ⇒ 68 ⇒ 33 ...
* 37 ⇒ 103 ⇒ 117 ⇒ 111 ⇒ 120 ⇒ 58 ⇒ 37 ...
* 41 ⇒ 102 ⇒ 96 ⇒ 60 ⇒ 51 ⇒ 41 ...
* 42 ⇒ 114 ⇒ 125 ⇒ 105 ⇒ 42 ...
* 50 ⇒ 80 ⇒ 66 ⇒ 62 ⇒ 76 ⇒ 79 ⇒ 67 ⇒ 85 ⇒ 73 ⇒ 50 ...
* 70 ⇒ 74 ⇒ 70 ...

These cycles can be used to create loops that do different things each time and that eventually become repetitive. Lou Scheffer used this idea to create a Malbolge program (included in his cryptanalysis linked below) that repeats anything the user inputs.


Variants

Malbolge is not
Turing-complete In computability theory, a system of data-manipulation rules (such as a computer's instruction set, a programming language, or a cellular automaton) is said to be Turing-complete or computationally universal if it can be used to simulate any Tur ...
, due to its memory limits. However, it otherwise has sequential execution, repetition, and conditional-execution. Several attempts have been made to create Turing-complete versions of Malbolge: * Malbolge20 is a version of Malbolge with an expanded word-size of 20 trits, allowing one to write a program with a size of up to ~3.4 gigabytes. * Malbolge-T is a theoretical version of Malbolge that resets the input/output stream upon reaching the end, allowing for unbounded programs. Malbolge-T would be
backward compatible Backward compatibility (sometimes known as backwards compatibility) is a property of an operating system, product, or technology that allows for interoperability with an older legacy system, or with input designed for such a system, especially in ...
with Malbolge. * Malbolge Unshackled is a hopefully Turing-complete variation, allowing for programs of any length. However, due to command variations to allow for values above 257, valid Malbolge programs will not necessarily run correctly in Malbolge Unshackled.


Popular culture

In the television series ''Elementary'', during the episode "The Leviathan" (season 1, episode 10), a clue written on a coffee order is described as having been written in Malbolge. It appears to be a small modification of the more verbose "Hello World" example shown above. In the '' Leverage: Redemption'' episode "The Golf Job" (season 1, episode 12), an SMS auto-reply reads "Breanna is unavailable Thursday through Sunday or until she masters Malbolge code." In the '' Billions'' episode "The Limitless Shit" (season 5, episode 7), a programmer analyst at Axe Capital explains that he "... used to dick around with Malbolge, but just for fun."


See also

*
INTERCAL The Compiler Language With No Pronounceable Acronym (INTERCAL) is an esoteric programming language that was created as a parody by Don Woods and , two Princeton University students, in 1972. It satirizes aspects of the various programming langu ...
*
Obfuscated code In software development, obfuscation is the act of creating source or machine code that is difficult for humans or computers to understand. Like obfuscation in natural language, it may use needlessly roundabout expressions to compose statement ...


References

{{Reflist, 30em


External links


Malbolge interpreter (C source code)

Malbolge interpreter, debugger, assembler and example Malbolge Assembly code (Java source code)

Treatise on writing Malbolge programs; takes Scheffer's analysis a bit further

A project devoted to present programs written in Malbolge
Esoteric programming languages Non-English-based programming languages Programming languages created in 1998