Re:Ruby: Porting YJIT to Rust
by p4lindromica on Monday January 17, 2022 @08:44PM
(#29973929)
Hi, Artichoke author here. I feel very blessed to have Artichoke be mentioned in this ticket on Ruby's bug tracker. If y'all are interested to follow along, @artichokeruby on Twitter is the best spot to do it.
It's worth noting that their backend (VM and parser) currently uses MRuby, which is written in C, so not yet quite a "real" implementation in my view.
The mruby VM as used in Artichoke uses Artichoke's Rust implementations of `String`, `Symbol`, and `Array` (and many other core classes, these ones just happen to be used by the VM itself). The symbol table (which is an essential part of how classes and methods and `send` are implemented) is implemented using the `intaglio` crate which is part of the Artichoke project.
These implemented-in-Rust bits expose themselves to the remaining C with `extern "C"` APIs written in Rust that maintain ABI compat with the mruby code they replace.
The mruby VM is getting eaten by the Rust parts, so I don't think it's quite fair to say that Artichoke uses mruby as an off the shelf component. To fully move beyond mruby though to a native Rust VM will take time.
https://github.com/artichoke/artichoke
It’s ruby, implemented in rust. Early days, but very interesting.
(I have no affiliation or involvement with it, just a fan)