Brainfuck: a pilgrimage

This is a re-post with minor edits of a static webpage I had on an old, almost forgotten server; I’ve backdated it to match the ctime.

In the winter of 2003, my last year at high-school, I fell into the wonderful world of Brainfuck. This quickly turned from an interest, to an addiction, to a pilgrimage.

With tertiary-entrance exams due in a month, what was I to do but write a brainfuck interpreter in brainfuck. Using 8 instructions, an interpreter, and emacs, I coded myself into a state of delirium.

Ouch.
Ouch.

Yes, it took me a few hours (mostly between midnight and sunrise), but here it is: the brainfuck interpreter in 446 bytes of brainfuck. There’s a longer 456-byte version that doesn’t mind comments. Daniel informed me that he’s got a new, unreleased interpreter down to 425 bytes; and that making the same non-standard assumptions I did would shave his old interpreter down to 362 bytes. Ah well.

In doing so, I found that the ENSI Brainfuck Standard v1.3 could benefit from some reform to allow for conformant and standardised brainfuck interpreters written in brainfuck. Daniel has quite good general guidelines in his Epistle to the Implementors page. However, I’m inclined to disagree with some of the conventions there that seem to have arisen out of needless tradition rather than best practices (why, oh why 30,000?). But it will do for now ;)

Part of my disagreement with the arbitrary 30,000 comes from implementing brainfuck on platforms with limited memory. I wrote an interpreter for my TI-86 calculator.

Leave a Reply

Your email address will not be published.