Brainfuck Compiler and Interpreter written in c
Note: Written for Linux. May work on other OSes. Will almost certainly not work on Windows.
- nasm
- gcc
- Compile compile.c (ie:
gcc -o compile compile.c
) - Run run.sh with format
./run.sh brainfuckfile.bf outputbinary
- Test your code with
./outputbinary
- Some kind of c compiler (ie: gcc, clang)
- Compile interpret.c (ie:
gcc -o interpret interpret.c
orclang -o interpret interpret.c
) - run interpret on your Brainfuck program (ie:
./interpret brainfuckfile.bf
)
-
I don't intend to optimize the current compile.c further as I feel it would lose some of it's charm as it gets further from bf.
-
I may make a second compiler that optimizes bf a lot heavier.