Leet (programming language)

Leet (or L33t) is an esoteric programming language based loosely on Brainfuck and named for the resemblance of its source code to the symbolic language "L33t 5p34k". L33t was designed by Stephen McGreal and Alex Mole to be as confusing as possible. It is Turing-complete and has the possibility for self-modifying code. Software written in the language can make network connections and may therefore be used to write malware.

Language specification
The basic data unit of L33t is the unsigned byte (big-endian), which can represent ASCII values and numbers in the range 0-255.

The source code is in "l33t 5p34k" and words are separated by spaces or carriage returns. The language uses 10 opcodes and each word in the source code is translated into an opcode by adding all the digits in the word together, e.g. l33t = 3 + 3 = 6. It is not necessary to use anything but digits in the code.

The language uses a 64K block of memory, and 2 pointers - a memory pointer and an instruction pointer. The l33t interpreter tokenizes all the words in the source to create a sequence of numerical opcodes, and places them in order into the memory block, starting at byte 0. The instruction pointer will keep incrementing until it encounters an END. The memory pointer starts at the first byte after the instructions. Memory "wraps": incrementing the memory and the instruction pointer past 64K will cause it to run around to byte 0, and vice versa.

Memory pointers can also be moved into the area of memory occupied by the instructions, so code can be self modified at runtime. Similarly, the instruction pointer will continue incrementing or jumping until it encounters an END, so code can be generated at runtime and subsequently executed.

Bugs
F00l! teh c0d3 1s b1g3R th4n teh m3m0ry!!1! You tried to load a program that is too big to fit in the memory. Note that at compile time, one byte is reserved for the memory buffer, so the program's size must be less than the memory size minus one byte. Byt3 s1z3 must be at l34st 11, n00b! The byte_size argument of new was less than 11. The byte size of an interpreter must be at least 11 (to accommodate for the opcodes). L0L!!1!1!! n0 l33t pr0gr4m l04d3d, sUxX0r! run called before any program was loaded.

Python
Written by Alex Mole. Does not support the CON opcode, but otherwise considered the "definitive" interpreter.

Ruby
Written by Eric Redmond. This one contains an implementation of CON.

JavaScript
By Phil McCarthy, it is based on the Python one but is a bit more interactive.

C
Interpreters for C have been written by Kuisma Salonen (for use in Linux) and by Alecs King.

Perl 6
By Gaal Yahas. This interpreter is notable for being the first which comes with a debugger.