A toy x86 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 an x86_64 JIT compiler written using dynasm-rs
(a project to write JIT compiler using an assembly syntax). It can be found in (./src/jit/asm.rs
).
The last (./src/jit/machine.rs
) is also an x86_64 JIT compiler but written without dynasm-rs
. That means the file directly contains a piece of machine code.
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. They allocate
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.