A brainfuck JIT and interpreter set
I wanted to write a brainfuck interpreter. They are inherently quite useless
rustfuck
contains 4 interpreters as well as an optimising JIT-compiler (currently only available on AArch64).
The 4 backends:
- BF interpreter - executes brainfuck, as-is
- takes around 30s on
mandelbrot.b
- takes around 30s on
- HIR interpreter - only fuses
+-
s and<>
s, as well as creating a branch lookup table- takes around 5s on
mandelbrot.b
- takes around 5s on
- LIR interpreter - additiionally performs a bunch of different loop optimisations to
- takes around 2.7s on
mandelbrot.b
- takes around 2.7s on
- JIT compiler - emits raw machine code (doesn't currently support reading from STDIN)
- takes around 600ms on
mandelbrot.b
- takes around 600ms on
There are several examples in the examples
folder, including hello_world
and mandelbrot
.