A Brainfuck Interpreter

From Wikipedia, the free encyclopedia.

Brainfuck (from the English brain + fuck) is one of the best-known esoteric programming languages, created by Urban Müller in 1993 just for fun. The language has eight commands, each written as a single character. The source code of a Brainfuck program is simply a sequence of these characters, with no additional syntax whatsoever.

One of Urban Müller's goals was to create a language with the smallest possible compiler. He was partly inspired by the FALSE language, which had a 1024-byte compiler. There are Brainfuck compilers smaller than 200 bytes.

Writing programs in Brainfuck is hard, which is why it is sometimes called a language for masochists. It is worth noting, however, that Brainfuck is a perfectly natural, complete and simple language and can be used in defining the notion of computability.

The machine controlled by Brainfuck commands consists of an ordered set of cells and a pointer to the current cell, resembling the tape and head of a Turing machine. In addition, it assumes a device for communicating with the outside world (see the . and , commands) through an input stream and an output stream.

Download the source code of the interpreter.

Only registered users can leave a comment.

Sign in or register to leave a comment.