3 ms·
JRuby is canonical and both teams contribute to ruby/spec. JRuby does not alter the language unlike Rubinius. MJIT uses C to mimize the maintenance burden on t
by jashmatthews 8y ago
JRuby is canonical and both teams contribute to ruby/spec. JRuby does not alter the language unlike Rubinius.
MJIT uses C to mimize the maintenance burden on the core team. Using LLVM would mean either pinning to an LLVM version as Rust does or supporting what would probably be 6 different versions of IR to support as far back as say, Ubuntu 14.04.
- pjmlp 8y agoFaire enough regarding JRuby. As for MJIT, it is not like LLVM would be the only way to implement a JIT compiler, plus the impact of forking a C compiler and linker is quite considerable versus an in-process JIT.
- jashmatthews 8y agoCRuby needs a full C compiler and linker for JIT to be able to inline things like object allocation. The alternative proposal which Evan Phoenix explored was to compile the VM and standard library into LLVM IR and keep it for use when JIT compiling Ruby methods. If you look at the JIT compiler in Racket which is maintained by a small team like CRuby but does use a custom backend, then it has some big limitations like a maximum of 3 function args. Implementing something like C1 would be an enormous amount of work.
- samth 8y agoI'm not sure what you mean about a maximum of 3 arguments, but the Racket JIT runs on all functions no matter how many arguments they take.
- jashmatthews 8y agoHah, thanks! I was reading the Racket JIT source code late and mixed something up.
- samth 8y agoCertainly, as in almost every JIT I know of, there are limits on which things get optimized in certain ways, which may be what you saw.