another toy Ruby implementation with a fast JIT compiler written in Rust.
- register-based bytecode.
- bytecode executer (virtual machine) written in x86-64 assembly (yes, we currently support only x86-64!).
- a compact and fast JIT compiler. (internally using self-made dynamic assembler monoasm)
This project still remains in early-alpha stage. Currently, only the functionalities described below are implemented.
- classes: Integer, Float, String, Symbol, Class
- superclass and singleton class and methods
- local variables
- if-then-elsif-end statement
- for-in statement
- while statement
- method definition
- measured by benchmark-driver with '--repeat-count 3' option.
- shown in iteration/sec (the higher, the better).
impl \ bench | app_fib (fib 40) | so_mandelbrot |
---|---|---|
monoruby --jit | 1.401 | 1.339 |
monoruby | 0.174 | 0.910 |
ruby(3.2.0dev) | 0.202 | 0.673 |
ruby --yjit | 0.816 | 0.897 |
ruby --mjit | 0.566 | 0.754 |
To build monoruby, You'll need installation of Rust. Please be aware that only nightly version of Rust works for monoruby.
To run ruby program file on monoruby,
% cargo run app_fib.rb
or
% cargo run --release -- app_fib.rb
one liner
% cargo run -- -e "puts 100"
You can launch REPL, omitting file name.
% cargo run