Malbolge (a second look)

A page from the mysterious Voynich Manuscript at Yale’s Beinecke Rare Book and Manuscript Library

Oklo dot org certainly wouldn’t be considered a heavily trafficked website, but given that it’s been on line for more than sixteen years, it does attract a uniformly steady trickle of visitors. Examining the Google Analytics, one notices curious ebbs and flows of activity, and one item stands out: This 2013 post, on the esoteric programming language Malbolge attracts of order ten visits per day with remarkable consistency. It’s not fully clear why.

Quoting from the 2013 post, which in turn drew from the Wikipedia article of that era,

Malbolge is a public domain esoteric programming language invented by Ben Olmstead in 1998, named after the eighth circle of hell in Dante’s Inferno, the Malebolge.

The peculiarity of Malbolge is that it was specifically designed to be impossible to write useful programs in. However, weaknesses in this design have been found that make it possible (though still very difficult) to write Malbolge programs in an organized fashion.

Malbolge was so difficult to understand when it arrived that it took two years for the first Malbolge program to appear. The first Malbolge program was not written by a human being, it was generated by a beam search algorithm designed by Andrew Cooke and implemented in Lisp.

The “Hello World” source can be represented (see here for details):

(=<`#9]~6ZY327Uv4-QsqpMn&+Ij"'E%e{Ab~w=_:]Kw%o44Uqp0/Q?xNvL:`H%c#DD2^WV>gY;dts76qKJImZkj

Due to its finite number (3^10) of memory locations that each hold a ten-‘trit’ ternary number, the classical specifcation of Malbolge is not Turing complete. A version, however, known as Malbolge Unshackled that is now understood to be Turing complete was released in 2007.

Indeed, in the interval following the 2013 post, it develops that there has been significant progress on Malbolge. Key advances were made by Lou Scheffer, who elucidates the critical realization on his website:

The correct way to think about Malbolge, I’m convinced, is as a cryptographer and not a programmer. Think of it as a complex code and/or algorithm that transforms input to output. Then study it to see if you can take advantage of its weaknesses to forge a message that produced the output you want.

And with that, a strange world just over the horizon begins to congeal in the mind’s eye. A Malbolge program, viewed in this manner is not unlike an inefficient, inherently compromised cousin to the SHA-256 hash. One imagines bizarre blockchains. Esoteric cryptocurrencies. NFTs.

Exploiting weaknesses in the language, Scheffer demonstrated existence of a program that copies its input to its output, effectively performing the Unix echo command. The source (uu-encoded) looks like this:

begin 666 copy.mb
M1"="04 _/CT\.SHY.#<V-30S,C$P+RXM+"LJ*2@G)B4D(R(A?GU\>WIY>'=V
M=71S<G%P;VYM;&MJ:6AG9F5D8V)A8%]>75Q;6EE85U955%-245!/3DU,2TI)
M2$=&141#0D% /SX]/#LZ.3@W-C4T,S(Q,"\N+2PK*BDH)R8E)",B(7Y]?'MZ
M>7AW=G5T<W)Q<&]N;6QK:FEH9V9E9&-B86!?7EU<6UI96%=655134E%03TY-
M3$M*24A'1D5$0R9?O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]
MO;V]Y+V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]
MO;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]
MO;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]
MO;V]O>2]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]
DO;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;V]O;T*

Over the past two years an amazing additional development has taken place. At her GitHub site, Kamila Szewczyk has published a LISP interpreter written in Malbolge Unshackled. The interpreter takes a LISP program, executes it, and displays the result. The abstract of her accompanying paper reads:

MalbolgeLISP is the most complex Malbolge Unshackled program to date (2020, 2021).
Unlike other Malbolge programs generated by different toolchains (for instance, LAL, HAL
or the ”pseudo-instruction” language developed by the Nagoya university), MalbolgeLISP
can be used to express complex computations (like folds, monads, efficient scans, iteration
and point-free programming), while being able to run within reasonable time and resource
constrains on mid-end personal computers. The project aims to research not the cryptanal-
ysis aspect of Malbolge, but its suitability for complex appliances, which could be useful for
cryptography and intellectual property protection, and it would certainly raise the bar for
future Malbolge programs while exploring functional and array programming possibilities
using inherently imperative and polymorphism-oriented Malbolge code.

Time to get to work on the Malbola white paper and issue a coin.