BrainFuck for Emacs

What the Fuck is BrainFuck?

BrainFuck is a turing complete programming language. It consists only of 8 different operators, which are represented by single characters each.

These operations manipulate a memory pointer, which points into a memory area of 30000 cells, each initially initialised to zero.

List of all BrainFuck operators
CharacterDescription
+ Add 1 to the memory cell the pointer currently points to
- Subtract 1 from the cell currently pointed to
> Increase the pointer, pointing to the next memory cell
< Decrease the pointer by 1 memory cell
. Output value of the current cell as a byte
, Read input and set the current cell
[ If current cell is zero, goto end of loop, else continue
] Goto beginning of loop

An Emacs Lisp Implementation

bf.el is an implementation of the BrainFuck programming language for GNU Emacs. It implements an interpreter for BrainFuck, as well as a compiler which can compile BrainFuck code to native Emacs Lisp byte code.

bf.el uses a BF interpreter written in BF to test correctness. The included test case can take very long, depending on the hardware you are running it on, but it should pass without failure.

Last Modified: 2006-11-27 00:02:53
You can view the Source Code of this page