A toy AMD64 and ARMv8-A JIT compiler and interpreter for Brainf*ck written in Rust.
This project includes 3 implementations of Brainf*ck, complying the reference by Daniel B. Cristofani.
One is an interpreter (./src/interpreter.rs
) in pure Rust. It is used as a reference implementation for more complex other two implementations.
The second one is a JIT compiler written using dynasm-rs
(a project to write JIT compiler using an assembly syntax). It supports both AMD64 and ARMv8-A. It can be found in (./src/jit/asm.rs
).
The last (./src/jit/machine.rs
) is also a JIT compiler but written without dynasm-rs
. That means the file directly contains a piece of machine code. It only supports AMD64.
Note that the dynasm-rs
based JIT doesn't support Windows on AMD64.
One somewhat unique feature of this project is that all three implement memory protection by allocating more memory than a guest's address space to avoid bound checking. This allocates
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.