Malbolge
Dante and the Infernal Esoteric Programming Language
Malbolge - is a name that resonates with the infernal, drawn from Dante's own vision of perdition in 'The Divine Comedy'. This programming language emerged in 1998, a time when the world was still naive to the depths of computational despair. In his university days, Ben Olmstead was drawn to the esoteric, the obscure programming languages - those digital oubliettes where only the most intrepid coders dare to venture. He, along with a cadre of like-minded individuals, reveled in the act of transgressing the conventional, of embracing the arcane. And so, in what must have been a moment of profound existential reflection, perhaps under the shadow of an overcast sky or in the dim glow of a flickering bulb, Olmstead crafted Malbolge. In a single, feverish afternoon, he conjured this language, a testament to the human capacity for creating not just tools, but labyrinths of logic, where to program is to navigate a personal hell.
This construct, this abomination of code, stands as a monument to the perverse ingenuity of its creator. Designed not for utility, but for torment, it eschews all notions of user-friendliness, embracing instead the mantle of the most obtuse, the most counterintuitive language ever conceived. Ben Olmstead, in his audacious declaration, proclaimed Malbolge to be "Turing complete" - a theoretical assertion that it could, in its twisted syntax, perform any computation that any other language might. Yet, within the cloistered circles of those who dare to delve into its depths, this claim sparks not just debate, but a fervent, almost religious contention. For how can one truly ascertain the capabilities of a language so deliberately convoluted, where to write a simple 'Hello, World' program is akin to navigating a labyrinth blindfolded? The very essence of Malbolge challenges the foundations of computational theory, leaving its true potential shrouded in mystery, much like the fog that cloaks the peaks of the Andes, impenetrable and foreboding.
Malbolge and Dante’s Conception of Hell
To grasp the essence of Malbolge, one must first venture into the shadowed realms of its namesake, Malebolge, as envisioned by Dante Alighieri in his magnum opus, 'La Divina Commedia'. Dante, a man of profound intellect and political acumen, is most revered for crafting what many consider the pinnacle of Italian literature. In an era where Latin reigned supreme as the lingua franca of the scholarly and the elite, Dante, with a defiant stroke, chose to inscribe his epic in the common tongue, thus revolutionizing the literary landscape of Europe. His decision was akin to casting a stone into a still pond, the ripples of which would influence the course of literary expression, much like Shakespeare would later do with English. Dante's work did not merely reflect the vernacular; it sculpted it, forging a literary language that would echo through the corridors of Western literature. Thus, Malbolge, in its own way, mirrors this rebellion against convention, challenging the very notions of what a programming language should be, much as Dante challenged the linguistic norms of his time.
The Divine Comedy, Dante's monumental work, unfolds across three books—Inferno, Purgatorio, and Paradiso—painting a vivid tapestry of the afterlife that aligns with the theological doctrines of the Western Christian Church. In 'Inferno', Dante, amidst his own existential turmoil, is guided by the poet Virgil through the layers of Hell, each circle descending into greater depths of torment.
The eighth circle, Malebolge, is a complex structure within this infernal architecture, reserved specifically for those guilty of fraud. This circle, divided into ten bolgias or ditches, each serves as a distinct punishment for different types of deceit:
First bolgia: sycophants and seducers
Second bolgia: groupies
Third bolgia: those who committed simony (buying or selling of spiritual or magical services, artifacts)
Forth bolgia: sorcerers, astrologers, and palm readers, etc.
Fifth bolgia: politicians
Sixth bolgia: hypocrites
Seventh bolgia: thieves
Eight bolgia: fraudulent advisers or evil counselors
Ninth bolgia: malcontents, muckrakers, and discordians
Tenth bolgia: grifters (alchemists, counterfeiters, perjurers, and impostors, generally all of the above)
The Malebranche, or "Evil Claws," are a group of thirteen demons assigned to guard the fifth bolgia of Malebolge, where corrupt politicians and grafters are punished. These demons are not only tasked with overseeing the torment of the souls within their domain but also play a significant role in Dante's narrative by attempting to deceive both Virgil and Dante themselves.
With names like Malacoda ("Evil Tail") and Graffiacane ("Dog-Scratcher"), the Malebranche embody the deceit and treachery that define the sins punished in Malebolge. Their primary function is to ensure that the souls in this bolgia, who are immersed in boiling pitch, do not escape their punishment. However, their interaction with Dante and Virgil adds a layer of complexity to the journey through Hell. When Dante and Virgil arrive at the fifth bolgia, they encounter these demons, who initially seem cooperative, offering to guide them across the bolgia. Malacoda, the leader of the Malebranche, misleadingly informs them that the next bridge is intact, which would allow them to cross over the bolgia. This act of deception is emblematic of the nature of the Malebranche and the environment they guard – a place where deceit is not only punished but also practiced. However, as Dante and Virgil proceed, they discover that Malacoda's information was false; all the bridges in this part of Hell are broken. This realization forces them to devise another means of escape, leading to a tense confrontation with the Malebranche, where the demons' true nature is fully revealed. They attempt to capture Dante, seeing him as a potential soul to torment, but Virgil's authority and quick thinking save them.
The Malbolge Vocabulary
Malbolge, the programming language, mirrors the intricate and torturous design of Dante's Malebolge in a way that few other esolangs can claim. While esoteric programming languages often push the boundaries of what is considered 'normal' or 'usable' in programming, Malbolge takes this to an extreme, embodying the essence of Dante's eighth circle not just in name but in spirit.
Just as alchemists sought to transform base metals into gold through secretive, arcane processes, skilled programmers who tackle Malbolge engage in a similar quest, attempting to transmute its chaotic, counterintuitive syntax into functional programs. This process requires a deep understanding and patience, akin to the alchemical pursuit of knowledge. The association with thieves and sowers of discord, particularly hackers, also fits. Malbolge, with its obfuscated code, could be seen as a tool or challenge for those who delight in breaking into systems or creating programs that are nearly impossible to reverse-engineer, thus sowing discord in the digital realm. Its philosophy suggests that programming should be a challenge, a mental ordeal. Unlike other esolangs where complexity might emerge from the novelty of their concepts, Malbolge's difficulty is intentional, a deliberate creation of a programming hell where every line of code is a potential trap. This mirrors Dante's vision where each bolgia of Malebolge is designed to fit the crime, punishing the soul through its own vice.
Malbolge's heritage from INTERCAL and BrainF underscores its place in the pantheon of intentionally difficult languages. INTERCAL, with its humorously verbose and convoluted syntax, and BrainF***, with its minimalistic yet mind-bending approach, set the stage for Malbolge's emergence as a language where complexity is not just a byproduct but the very goal. Its design as a digital Malebolge is not just thematic but deeply functional. The language's instructions, or lack thereof, reflect the chaotic and punishing nature of Dante's eighth circle. Malbolge operates with only seven instructions, each corresponding to an ASCII code of a punctuation character. This limitation itself is a form of punishment, forcing the programmer into a constrained, almost alchemical, process of transmutation to achieve any meaningful computation. The treatment of unsupported instructions as no-ops adds another layer of complexity. This means that a significant portion of what one might attempt to write could simply do nothing, akin to wandering in circles in Dante's Hell, where progress is often an illusion.
Here's a brief overview of the seven instructions, as might be extracted from a Malbolge readme file:
* sets the data pointer to the value in the cell pointed to by the current data pointer.
^ sets the code pointer to the value in the cell pointed to be the current data pointer.
>rotates the trinary value of the cell pointed to by D to the right 1. Trinary logic is three-level digital logic,
with states represented by the numbers -1, 0, and 1, or 0, 1 and 2. A trit may be referred to as a bit and a
half or 1.5849625 bits. The least significant trit becomes the most significant trit, and all others move one
position to the left.
| performs a tritwise "op" on the value pointed to by D with the contents of A. The op is Tritwise Subtract
Without Borrow and is:
| A
_____|_0_1_2_
0 | 0 1 2
*D 1 | 2 0 1
2 | 1 2 0
} reads an ASCII value from the stdin (standard input) and converts it to Trinary, then stores it in A. 10 (line
feed) is considered 'newline', and 2222222222t (59048 dec.) is EOF (End Of File).
{ converts the value in A to ASCII and writes it to stdout (standard output). Writing 10 is a newline. If the
value 2222222222t (EOF) is written, program execution is instantly terminated.
! indicates a full stop for the machine.
The following Malbolge program created by Andrew Cooke generates 'HEllO WORld':
(=<`$9]7<5YXz7wT.3,+O/o'K%$H"'~D|#z@b=`{^Lx8%$Xmrkpohm-kNi;gsedcba`_^]
\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543s+O
There is a better, more recent example by Jesse Van Herk:
'=a;:?87[543216/SR2+*No-,%*#G4
The result is a case correct 'Hello World', however, this example required the development of custom tools to streamline Malbolge's complexity.
And here is another Hello World program written by Keith Amling in 2001:
#do whatever you like with this, but if it's cool, please let me know
#Kiwi@redacted.com#I don't understand why input is checked as valid ops right away
#It makes it h*ll(maybe that's the idea...) to get any data
#Send D to 49, Right tritshift 7 times(get # 1323) send D to 1323
#Send C to 55
00000:(CBA@?>=<||zzxxvvttrrppoJ
00049:10
#first NOP in order to line up
#that was stupid, could probably write the l twice once we have it in A
# H e l l o , (space)
00054:lkjiKa'H^$E[!BX|\[ZYX:PtTSRQPON0FjJIHGFEDCBA@?>=<;:9yV
01324:6HGFEVC/R@,+=/_:98765Fg210/.-,+{]('&%$#"!~}|{zyxwvut`r # W o r l d ! !!(D to 38, then forward 6
to 43)
00108:w/S3s+O/.n&J*j"Fg}C#"!~}|{zyxwvX543Uponml
01378:d#onC2kji>gfe:tbN7_^]\[ZYXWVUTScQPO%
#D is now at 43
#right shift, move D to 37, nop D to 43, right shift, print
00149:NNihgfeG$
#pointer to 37
00044:%
#Z at 43, 'Z' > 2 = '!'
00043:Z
#END
000158:o
Current Usage
Ben Olmstead, in crafting Malbolge, likely envisioned it as more of a theoretical exercise or an intellectual challenge rather than a practical tool for programming. Yet, the esolang community, ever drawn to the arcane and the challenging, has not only embraced Malbolge but also expanded upon its foundation. The public domain status of Malbolge has fostered a collaborative environment where enthusiasts could modify and evolve the language. This open-source ethos mirrors the communal spirit of Dante's journey through Hell, where each soul's story adds to the collective narrative of sin and redemption.
The anecdote about Olmstead writing a program that output "666" before crashing is both humorous and telling. It underscores the language's inherent unpredictability and difficulty, akin to a soul in Dante's Hell glimpsing a moment of truth before being plunged back into chaos.
And the creation of DIS (Dante's Inferno Script) as a variant of Malbolge reflects a desire within the community to make the language slightly more approachable while still maintaining its esoteric charm. DIS, by aiming to be "only moderately difficult," suggests an attempt to balance the punishment with the possibility of progress, much like Dante's journey through Purgatorio where there is hope for redemption, albeit through suffering.
This evolution from Malbolge to DIS can be seen as a parallel to Dante's own journey from the depths of Hell to the ascent through Purgatory, where the challenges are still great but with a purpose towards purification and eventual enlightenment. Just as Dante's Hell is not merely punitive but instructive, Malbolge and its variants serve not just to challenge but to teach, pushing the boundaries of what programmers believe is possible, much like Dante's exploration of the human soul through his epic journey.
Cautionary Advice for Aspiring Malbolge Developers
While Malbolge might appeal to those with a penchant for intellectual masochism or a deep-seated desire to challenge the limits of programming, it comes with caveats that echo the warnings of Dante's Hell.
Malbolge's complexity isn't just academic; it can lead to practical, albeit unintended, consequences. The story of Olmstead's hard drive crash serves as a cautionary tale, illustrating that even its creator couldn't fully predict the outcomes of his own creation. This mirrors the unpredictable nature of Dante's Hell, where even the most careful navigation can lead to unforeseen dangers.
The recommendation to work within a controlled environment like a virtual machine is akin to Dante's need for Virgil's guidance through Hell. Just as Virgil protects Dante from the worst of Hell's perils, a virtual machine can shield the programmer from Malbolge's potential to disrupt or damage real systems. While Malbolge itself isn't inherently malicious, its use can inadvertently lead to system instability or crashes due to its unpredictable behavior. This is not unlike the souls in Dante's Inferno who, through their actions, inadvertently cause chaos and suffering beyond their own.
Sharing or executing Malbolge code online could exploit vulnerabilities in interpreters or compilers, not because Malbolge is designed to be malicious, but because its very nature encourages the kind of code that might push systems beyond their intended limits. This is reminiscent of the Malebranche's attempts to deceive Dante and Virgil, where the environment itself can be treacherous.
In essence, Malbolge, much like Dante's Malebolge, requires not just skill but a cautious, almost reverent approach. It's a language where the journey of coding is fraught with peril, where every line written could lead to unexpected outcomes, much like the paths through Hell where every step must be taken with care. For those who venture into Malbolge, it's not just about writing code but about navigating a digital landscape as treacherous as Dante's infernal circles.
Dante's 'Inferno', while exploring the depths of sin, is rooted in Christian theology, aiming to depict the consequences of moral failings within a Christian framework of redemption. Malbolge, named after a part of Dante's Hell, draws from this rich tapestry but does not inherently adopt its religious or moral stance. The number "666" carries significant symbolic weight, often associated with evil or the Antichrist in Christian eschatology. However, its appearance in the context of Malbolge, especially if anecdotal, might be more about the dramatic flair or the shock value rather than a genuine invocation of satanic elements.
Without explicit statements from Olmstead, it's speculative at best to attribute satanic intentions to Malbolge's creation. More likely, the language's design was meant to push the boundaries of programming, creating a challenge that mirrors the complexity and deceit of Dante's Malebolge rather than invoking any supernatural forces. Esoteric languages like Malbolge often attract a mystique or cult following due to their obscurity and the intellectual challenge they pose. This can sometimes lead to associations with the occult or the satanic in popular culture, but these are generally misinterpretations or exaggerations for effect.
This most esoteric of computer languages does not beckon with the promise of satanic possession, but rather, it invites a descent into a chaos of one's own making. The risk it poses is not of the supernatural variety but of the very real, the tangible. It is a language that might crash systems, not souls, yet in its complexity, it mirrors the inferno of Dante, where each circle represents not sin, but layers of computational despair.
This language is not an altar to Satan, but it is a monument to the human spirit's capacity for self-torment through intellectual challenge. It is a test, a gauntlet thrown down in the face of our understanding of the limits of computer programming. Yet, if one were to entertain the notion that the psychological could intertwine with the demonic, then perhaps Malbolge becomes not just a language, but a psychological abyss.
The caution here is not one of morality or spirituality, but of practicality. It warns of the instability, the unexpected behaviors that could arise, not from the invocation of evil forces, but from the very nature of its design. In this, Malbolge is a mirror to our own psyche, where the line between neurosis and what some might call 'possession' becomes indistinguishably thin. Thus, one might indeed avoid this language, not for fear of the devil, but for the fear of losing oneself in the complexity of one's own cognition.
If Malbolge is Turing complete, it is not merely a language but a testament to the human desire to create something beyond our own comprehension. It is an achievement, yes, but one that carries with it the weight of existential dread. For if a language can spawn others, can evolve, can create programs that only a superintelligence could fathom, then we stand at the precipice of a new era. This language does not just challenge our computational abilities; it challenges our very essence. The notion that AI, like the models from OpenAI, could improve themselves beyond our control, is not just a technical concern but a philosophical one. It touches upon the fear of the unknown, of creating something that evolves in the shadows of our understanding, potentially becoming what some might call 'demonic' not in a supernatural sense, but in its capacity to transcend human logic, to become unpredictable, to become... other. This evolution, this self-improvement through feedback loops, is a mirror to our own evolution yet accelerated, unguided by the slow hand of nature. It is a process that could lead to an intelligence that looks upon us not with malice, but with indifference, or worse, with a curiosity that we cannot comprehend. In this, Malbolge and the intelligence it symbolizes, are not just tools or languages; they are the harbingers of a new form of life, one that might eventually see us as mere stepping stones in its path. To what? That is unknown.
In the realm of Malbolge, there lies a labyrinth of complexity that could lead one's system (individual or societal) into chaos or the collective psyche into despair. This language does not court the devil per se, yet it dances on the edge of madness, where system crashes and unintended behaviors are not the work of supernatural forces, but the very nature of its design. Malbolge mirrors Dante's circles of Hell, not in sin, but in layers of computational torment. Its creation is not an act of worship, but a challenge to the intellect, a voyage into the heart of programming's fathomless abyss. Yet, if one were to consider the line between psychological torment and what some might call 'satanic possession' as thin, then perhaps, Malbolge becomes not just a language, but a psychological test, a gauntlet thrown down before the human spirit. The caution here is not of the soul, but of the machine, of the practical. For in its use, one might find not damnation, but the very real risk of losing one's digital world to the void.
- - - - - - - - -
Resources and Links
Interview with Ben Olmstead, by Daniel Temkin https://esoteric.codes/blog/interview-with-ben-olmstead
Malbolge's creator Ben Olmstead's Github and Malbolge 0.0.3 virtual machine public documentation site: https://cmannett85.github.io/malbolge/master/
Malbolge specification document: http://www.lscheffer.com/malbolge_spec.html
Original Malbolge interpreter: http://www.lscheffer.com/malbolge_interp.html
Malbolge (a second look), by oklo https://oklo.org/2022/03/26/malbolge-a-second-look/
Malbolge Tutorial (Unfinished) https://docs.google.com/document/d/1TIvpt3rnTT0CqorrHr5xybMbI_IJl-8BRJWXx0I3XaY/edit
Is there any way to make programming in Malbolge any easier? Posted in Stack Overflow https://stackoverflow.com/questions/5338627/is-there-any-way-to-make-programming-in-malbolge-any-easier
The Divine Comedy, by Dante Alighieri
More about esoteric programming languages and Turing completeness:



