by megumax · 4y ago · 0 comments
The real problem is whether or not the expense of porting it is justified. Taking a look at the git repository of it (before it was merged into upstream), I understand why they want to rewrite it in Rust, the repository looks like a complete mess. I don't know if they want to use an existing JIT codegen like LLVM or Cranelift, or their own.
The goals and constraints of practical dynlang JITs often differ a bit from those for statically typed languages. The JITs for statically typed languages are often fairly "straightforward" since the basic/primitive types are often known, and with the exception for dispatch optimizations, many large wins comes from register allocation,etc.
A dynlang JIT on the other hand far more often has unstable basic types that goes along with type guards,etc. You have a ton of optimizations in that regard that comes before it's even time to consider more than basic register allocation optimizations (See for example the recent posts on the new Erlang JIT).
In this particular case Maxime's PHd was a JS JIT that implemented something called Basic-Block-Versioning, you can see an early paper on this at https://arxiv.org/abs/1411.0352
My suspicion is that the existing codegens you mention comes with a lot of baggage that might be in the way of how a lazy codegen like they want should be structured. I wrote a small experimental lazy dynamic JIT once and the structure definitely got twisted around and "direct" access to all parts definitely was a plus.
Ruby has support for plenty of "exotic" systems like HP UX, AIX etc. It's unclear how many people actually use it, but it's there.
> I don't know if they want to use an existing JIT codegen like LLVM or Cranelift, or their own.
Their own.
My bad, that's really not what I understood from your initial statement. But yes agreed.
The only real downside is discussed on the ticket. Ruby is primarily installed from source, so requiring a second toolchain is not ideal.
No idea about HP-UX, it is impossible to find anything now, apparently HPE has buried almost everything about it. Completely unrelated to how good it used to be about 20 years ago.