Brainfuck Process Extensions


Welcome to the Kees Jan Koster’s pages of the compiler for brainfuck with Process Extensions (BFPX).


It has been a while since there has been any serious work on the brainfuck language. In particular, nobody seems to have brought serious parallel processing to brainfuck. Demanding enterprise environments make it harder and harder to come by without multithreading in programming languages. Even for brainfuck, a language who's primary concern has not been ease of use and eyecandy syntax, basic parallelism is sorely missed.

BFPX fills this gap by introducing processes that run concurrently and channels for communication and synchronisation. Features are clean separation of process state, an easy to use communication and synchronisation mechanism and high scalability due to the use of particularly lightweight threads.


Brian Raiter describes brainfuck as follows: “Brainfuck is the ungodly creation of Urban Müller, whose goal was apparently to create a Turing-complete language for which he could write the smallest compiler ever, for the Amiga OS 2.0. His compiler was 240 bytes in size. (Though he improved upon this later -- he informed me at one point that he had managed to bring it under 200 bytes.)”


I have written this compiler and added parallel processing to brainfuck as an exercise to experiment with continuations and to try out parallel processing in Java without using threads. These experiments are part of an Occam compiler I am working on, which I may or may not publish at a later date.

Reading Guide

The manual revises the brainfuck runtime system. While seasoned brainfuck developers will feel right at home in the new runtime environment, there are a few changes that may take a little getting used to. The revised and extended syntax and the new I/O subsystem are introduced gently as part of this discussion.

The manual also describes how to use the brainfuck compiler to compile and run the sample code in this distribution. The case study dissects a complete program that showcases all of the new features of BFPX. These two pages should get you started with your own BFPX programs.

If you’d like to delve deeper into the code, you may find the under the hood page useful to get you started.

Finally, running BFPX explains how to compile and run BFPX programs.

if you find this interesting, terrible or just would like to know more, e-mail
web statistics
photo: David Schauer