X hits on this document

PDF document

1. INTRODUCTION - page 8 / 10





8 / 10

provided for accomplishing inequality tests. For example,

friendlier and jollier perform the

greater-than test, as








bastard?, while punier and worse test, as in are you punier than a

perform the less-than gentle king?

Another language, Chef, illustrates different design decisions for structuring play. Chef facilities double-coding programs as recipes. Variables are declared in an ingredients list, with amounts indicating the initial value (e.g., 114 g of red salmon). The type of measurement determines whether an ingredient is wet or dry; wet ingredients are output as characters, dry ingredients are output as numbers. Two types of memory are provided, mixing bowls and baking dishes. Mixing bowls hold ingredients which are still being manipulated, while baking dishes hold collections of ingredients to output. What makes Chef particularly interesting is that all operations have a sensible interpretation as a step in a food recipe. Where Shakespeare programs parody Shakespearean plays, and often contain dialog that doesn’t work as dialog in a play (“you are as hard as the sum of yourself and a stone wall”), it is possible to write programs in Chef that might reasonably be carried out as a recipe. Chef recipes do have the unfortunate tendency to produce huge quantities of food, however, particularly because the sous-chef may be asked to produce sub-recipes, such as sauces, in a loop.

A number of languages structuring play have been based on other weird languages. Brainfuck is particularly popular in this regard, spawning languages such as FuckFuck (operators are replaced with curse words) and Cow (instructions are all the word “moo” with various capitalizations).


Languages that have a puzzle aspect explicitly seek to make programming difficult by providing unusual, counter-intuitive control constructs and operators. While INTERCAL certainly has puzzle aspects, its dominant feature is its parody of 1960s language design. Malbolge, named after the eighth circle of hell in Dante’s Inferno, is a much more striking example of the puzzle language. Where INTERCAL sought to merely have no features in common with any other language, Malbolge had a different motivation, as author Ben Olmstead writes:

It was noticed that, in the field of esoteric programming languages, there was a particular and surprising void: no programming language known to the author was specifically designed to be difficult to program in. Certainly, there were languages which were difficult to write in, and far more were difficult to read (see:







INTERCAL and BrainF***, the two kings of mental torment, were designed with other goals … Hence the author created Malbolge. ... It was designed to be difficult to use, and so it is. It is designed to be incomprehensible, and so it is. So far, no Malbolge programs have been written. Thus, we cannot give an example. [9] Malbolge was designed in 1998. It was not until 2000 that Andrew Cooke, using AI search techniques, succeeded in

generating the first Malbolge program, the “hello, world!” program — actually, it prints HEllO WORld — that follows:

(=<`$9]7<5YXz7wT.3,+O/o'K%$H"'~D|#z@b=`{^Lx8%$Xmr kpohm-kNi;gsedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA @?>=<;:9876543s+O<oLm

The writing of complex Malboge programs was enabled by Lou Scheffer’s cryptanalysis of Malbolge and discovered “weaknesses” that the programmer can systematically exploit:

The correct way to think about Malboge, 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. [12] His analysis proved that the language allowed for universal computation. The “practical” result was the production of a Brainfuck to Malbolge compiler.

What makes Malbolge so difficult? Like many minimalist languages, Malbolge is a machine language written for a fictitious and feature-poor machine, and thus gains some difficulty of writing and significant difficulty of reading from the small amount of play provided to the programmer for expressing human, textual meanings. However, as Olmstead points out, the mere difficulty of machine language is not enough to produce a truly devilish language. The machine model upon which Malbolge runs has the following features which contribute to the difficulty of the language:

Trinary machine model. Programmers are used to all number representations bottoming out in binary representation at the machine-level. By making trits rather than bits the fundamental representation, this de-familiarizes the machine. This trinary orientation is borrowed from tri-INTERCAL, a trinary variant of INTERCAL.

Minimalism. Malbolge provides a minimal computational model. There are three registers, two of which are a data pointer and a code pointer, and seven instructions, represented by the ASCII characters (j i * p < / v). j and i manipulate the data and code pointer, * and p perform two trinary operations, < and / read and write characters from the A (accumulator) register, and v stops the machine.

Counterintuitive operations. Like INTERCAL, Malbolge does not provide standard constructs, such as conditional branching or arithmetic. Instead those operations must be built from two operations. * rotates the trinary cell pointed to by the D pointer 1 trit to the right. (Actually, bit-wise rotation is a standard operation on most computers — by providing this construct, Malbolge is being uncharacteristically forgiving.) p performs a tritwise operation on the contents of the A register and the number pointed to by D register. The p operation, often referred to as the crazy op, purposefully corresponds to no natural operation. In presenting the table that describes how trits are combined by the crazy op, Olmstead writes “don’t look for a pattern, it’s not there.”

Indirect instruction decoding. In standard machine models of computation, the code that will be executed next is determined by a program counter. Usually, after executing one instruction, the program counter is simply incremented so that it points to the next one. The only other thing that can happen is a “branch,” which corresponds, for instance, to if and GOTO

Document info
Document views40
Page views40
Page last viewedSun Jan 22 01:46:23 UTC 2017