Skip to content
All work

2026 · Low level, testing

Self hosting Brainfuck

A Brainfuck interpreter whose source is Brainfuck, shipped with a working food ordering system that takes orders on stdin and prints a receipt.

A closer look

Self hosting Brainfuck

An interpreter written in its own language

Repository

brainfuck2

pushed 12 Nov 2026

Commits in the last year

3

Language bytes

  • Brainfuck27k

The problem

An interpreter is the smallest honest test of whether you understand a language. Writing one inside the language itself removes every library that would otherwise hide a mistake.

What I built

  1. 01

    The interpreter is 596 bytes and implements all eight commands, nested loops, the full byte range and end of input as zero.

  2. 02

    Programs and their input are fed on one stream, separated by an exclamation point, because Brainfuck has no concept of files.

  3. 03

    A full order flow sits on top: menu, item, quantity, then a receipt with line items and a total, built from digit pairs.

  4. 04

    Each case was checked against the reference suite, including nested loops and rot13, with results recorded in the readme.

What it changed

  • A table of verified runs, not a claim of correctness.

  • The ordering system proves input handling and arithmetic in the same interpreter that runs it.

  • Small enough to read in one sitting.