A simple brainfuck interpreter, with JIT support.
You need to install llvm@18
and zstd
using Homebrew:
brew install llvm@18 zstd
You need to install llvm-18-dev
and libpolly-18-dev
:
sudo apt install llvm-18-dev libpolly-18-dev
cargo build --release
./target/release/bf <path-to-bf-file>
Or run with cranelift-jit/llvm-jit:
./target/release/bf <path-to-bf-file> jit --method [cranelift | llvm]
If you want to dump the ir:
./target/release/bf <path-to-bf-file> jit --method [cranelift | llvm] --dump-ir
If you encounter issues about missing LLVM_SYS_xxx_PREFIX
, you can build with the following command:
LLVM_SYS_180_PREFIX="/opt/homebrew/opt/llvm@18" cargo build --release
LLVM_SYS_180_PREFIX="/usr/lib/llvm-18" cargo build --release
If you need to modify LLVM-related environment variables, refer to .cargo/config.toml
.
This project is licensed under the MIT License.