brainfuck interpreter + x86_64 jit
the goal: accuracy first, then speed
- x86_64 only
- windows + linux
hello:
cargo run --release -- samples/hello.bfmandelbrot:
cargo run --release -- samples/mandelbrot.bfmodes:
cargo run --release -- samples/hello.bf --interp
cargo run --release -- samples/hello.bf --jitoptions:
cargo run --release -- samples/mandelbrot.bf --tape 30000
cargo run --release -- samples/mandelbrot.bf --guard
cargo run --release -- samples/mandelbrot.bf --noguard
cargo run --release -- samples/mandelbrot.bf --dump-ir
cargo run --release -- samples/mandelbrot.bf --dump-asmfast:
cargo bench --bench benchheavy (mandelbrot):
$env:BFJIT_HEAVY = "1"
cargo bench --bench bench -- mandelbrotrequires nightly:
cargo +nightly fuzz run ir_equiv
cargo +nightly fuzz run bf_equiv- interp is the oracle
- fuzz targets compare interp vs jit (tape + output)
- mandelbrot output matches byte-for-byte (interp vs jit)
mandelbrot on my box:
- interp: ~5.6s
- jit: ~0.85s
- jit compile: ~85us