Leet (or L33t) is an
esoteric programming language
An esoteric programming language (sometimes shortened to esolang) is a programming language designed to test the boundaries of computer programming language design, as a proof of concept, as software art, as a hacking interface to another language ...
based loosely on
Brainfuck
Brainfuck is an esoteric programming language created in 1993 by Urban Müller.
Notable for its extreme minimalism, the language consists of only eight simple commands, a data pointer and an instruction pointer. While it is fully Turing com ...
and named for the resemblance of its source code to the symbolic language "
L33t 5p34k". L33t was designed by Stephen McGreal
l33t Programming Language
/ref> and Alex Mole to be as confusing as possible. It is Turing-complete
In computability theory, a system of data-manipulation rules (such as a computer's instruction set, a programming language, or a cellular automaton) is said to be Turing-complete or computationally universal if it can be used to simulate any Tu ...
and has the possibility for self-modifying code
In computer science, self-modifying code (SMC) is code that alters its own instructions while it is executing – usually to reduce the instruction path length and improve performance or simply to reduce otherwise repetitively similar code ...
. Software
Software is a set of computer programs and associated software documentation, documentation and data (computing), data. This is in contrast to Computer hardware, hardware, from which the system is built and which actually performs the work.
...
written in the language can make network connections and may therefore be used to write malware
Malware (a portmanteau for ''malicious software'') is any software intentionally designed to cause disruption to a computer, server, client, or computer network, leak private information, gain unauthorized access to information or systems, de ...
.
Language specification
The basic data unit of L33t is the unsigned byte (big-endian
In computing, endianness, also known as byte sex, is the order or sequence of bytes of a word of digital data in computer memory. Endianness is primarily expressed as big-endian (BE) or little-endian (LE). A big-endian system stores the most si ...
), 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.
Opcodes
Bugs
F00l! c0d3 1s b1g3R th4n 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.
Interpreters
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.
References
{{Reflist
External links
Official Website
Leet on Esolang
Language-l33t-0.02 on CPAN
Esoteric programming languages