Sweet Jesus, I think Astra, Opus, and Argon have done it.
So, in @artichokeruby the Rust code is layered into several crate universes, like the layers I discussed in my harness engineering post. This layering largely exists for decomposition purposes because I intend the implementation of the Ruby core and standard libraries to not depend on a concrete interpreter assembly, and if you're doing this you might as well separate the raw data structures from things like argument marshaling. However! this architecture has the happy accident that only some layers are re-entrant into the interpreter.
Those layers are:
soffritto - ruby semantics (argument validation, arity checking, block forwarding, coercision, recursion checking, etc)
spinoso - Ruby data structures and algorithms (e.g. Array#shuffle)
scolapasta - raw vec, hash tables, platform adapters, etc; an absl like layer
I now have a custom rustc driver which translates the MIR (Rust’s intermediate representation before it is lowered to LLVM IR) only for that soffritto layer. We translate that MIR into my VM’s IR using some effects the code is annotated with + a custom prover.
Which means now this soffritto Rust, like an equivalently implemented method in Ruby, is suspendable for Ruby threads and fibers. The Rust frames are literally interpreter frames, on the interpreter stack, whose frame objects participate in GC liveness analysis. No stack walking, no stack switching assembly code.
this is fucking nuts!
It also means as call sites settle, the IR optimizer is actually able to see through those Rust native frames, which unlocks and incredible potential for optimization. And it means Cranelift will have A LOT to work with when I do add a JIT.
So unlike yjit, the JIT in CRuby, we are not limited to the handful of native methods the JIT has duplicate implementations of.
Separately, Argon has just reduced the memory overhead of my object model by 2.5x.
Even without this, Artichoke passes 91% of all ruby/spec compliance tests.
It is, as they say, simply a matter of tokens. May your rewards be verifiable.