An extremely optimized and fast Brainfuck interpreter written entirely in Go. Supports all commands as well as different methods for handling out-of-range memory errors.
You can either choose to download the source code as a ZIP file from the repository, or you can clone the repository using the command listed below.
git clone https://github.com/PassTheMayo/brainfuck.git
You will then need to move the working directory into the brainfuck
folder you just cloned.
cd brainfuck
To compile the interpreter, you can either use GNU Make which should come pre-installed on Ubuntu as well as many other Unix-based operating systems, or you can use the Go compiler itself.
make
# or
go build -o bin/main src/*.go # Unix
go build -o .\bin\main.exe src\*.go # Windows
You can now use the binary executable main
or main.exe
(OS-dependent) that resides in the bin
folder to run any Brainfuck program. Use --help
to list all options available.
There is an unofficial website for Brainfuck that has a lot of sample programs that you can use to test this interpreter. You can find that at this link.