mruby VM on Z80
The world’s least impressive mruby VM
The mrubyz repo is possibly the least impressive mruby VM “implementation” at the moment… it’s capable of running code like return 1 + 2
and nothing more.
I was at Ruby Retreat 2025 in Whangaparāoa when I decided I’d write my own mruby VM.
I had less than a day so I had to limit the scope,
So I decided the minimal instruction set I wanted to support was return 1 + 2
.
In the end, I managed to develop a VM that supported that, and showed it running on a Master System emulator to the attendees of Ruby Retreat 2025.
However, the interesting aspect of this vm is that it hasn’t implemented addition yet… It in fact, relies on mruby compiler’s optimisation! The VM is only loading the integer while the mrbc compiler generates bytecode that loads a static value 3!