News for hackers. Stuff that matters.
Re:Ruby: Porting YJIT to Rust by sandstrom on Monday January 17, 2022 @06:41PM (#29972994)
For anyone interested in Ruby and Rust, check out Artichoke.

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)

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.

https://twitter.com/artichokeruby

Re:Ruby: Porting YJIT to Rust by nusaru on Monday January 17, 2022 @10:55PM (#29974893)
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.
Re:Ruby: Porting YJIT to Rust by lopopolo on Monday January 17, 2022 @11:18PM (#29975045)
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.