Esoteric programming languages are often created to add a little bit of spice to the coding world. They're mysterious, often unsolvable for the average coder due to their unnecessary difficulty. Luckily, the world loves mystery and so do I. BranFlakes and Befunge seemed to be as bad as it could get, and then Malbolge was introduced. Funny enough, despite it's design it is possible to write useful programs in Malbolge like REBOL (relative expression based object language).
Malbolge was made to be almost impossible to use by making the code self altering and base-three arithmetic code. It builds on the difficulties of BranFlakes and Befunge by playing on older versions of computer science and encryption.
Who made it: Ben Olmstead, but the first program was written through a Beam Search algorithm (a quick problem solving search algorithm using breadth first search to build it's search tree)designed by Andrew Cooke through a Lisp implementation.
Malbolge was made in 1998 named after the 8th circle in Dante's Inferno. Two assembly languages exist to write Malbolge code. The first is LaL which was implemented by Japanese researchers and the second is HeLL due to a precise specification of LaL not being available as of 2013 (now available). It's use is not necessary, it is more to say that it was done rather than for useful applications.
Malbolge was generated by a Beam Search Algorithm: A heuristic search algorithm that only searches the most definitive nodes at a time. Because Beam Search expands limited nodes it is most beneficial for large searches. It utilizes best-search-first modification which alters log probability to return decent results. Beam search is often used in machine translation systems due to it's accuracy and ability to search larger databases.
Malbolge has 3 accessible memory locations (registers) a(accumulator), c(code pointer), d(data pointer). After every instruction if the memory that c points to is within the range of 33-126 then the following translation table is used:
When the interpreter executes a program it first checks to see if the proposed code is an ASCII character. If it is, it subtracts 33 from it and adds C and then modifies its character index by 94. If the original code is not an ASCII character the program automatically terminates.
This strange language has eight instructions and it's code functions based on trits of each machine word. The variable 'J' sets the pointer to the value already being pointed to. The variable 'i' sets the pointer to the value that will be pointed to. The character * rotates the trinary value of the cell that 'D' points to, to the right of 1. The variable 'P' performs a tritwise operation on the cell 'D' points to with contents of 'A'. The variable '<' reads the ASCII value from the stdin and converts it to Trinary and then stores it in A. The '/' converts the value in A to ASCII and then writes it in stdout. 'v' indicates the machines termination and lastly 'o' increments 'C' and 'D'.
A-Trits:
Di-Trits:
Trinary -> ASCII -> Decimal -> Hex-Table:
There are two techniques for writing Malbolge. The first is to print the text and terminate the code. The second technique is used for conditionals, loops, and inputs. In the second technique the developer designs the program as if every cell of memory can be initialized with arbitrary values, then generates the initialization code that writes the corresponding values into memory.
Malbolge is a wild and strange coding language that is not used very often. It's implementation is mostly for shock value and to show just how complicated machines can become. While it's not necessary to learn, it can be a great way of understanding how complex languages can get and how computers are able to interpret that complexity.
Sources:
https://en.wikipedia.org/wiki/Malbolge
https://en.wikipedia.org/wiki/Beam_search
https://dev.to/viz-x/malbolge-the-programming-language-designed-to-be-impossible-1bl7
https://www.geeksforgeeks.org/machine-learning/introduction-to-beam-search-algorithm/
https://direct.mit.edu/tacl/article/doi/10.1162/tacl_a_00346/96473/Best-First-Beam-Search
https://wiki.c2.com/?ProgrammingLanguageNamingPatterns
http://www.lscheffer.com/malbolge_spec.html
https://lutter.cc/malbolge/tutorial/cat.html






























