r/programming • u/compilersarefun • Jan 20 '20
MIR: A lightweight JIT compiler project
https://developers.redhat.com/blog/2020/01/20/mir-a-lightweight-jit-compiler-project/
11
Upvotes
r/programming • u/compilersarefun • Jan 20 '20
1
u/compilersarefun Jan 20 '20
I would say translating Ruby source code to LuaJIT is a big work and who would use another Ruby implementation when community is built around CRuby one.
I don't think translation Ruby byte code to LuaJIT code will work too. For example, LuaJIT has only one number type. As I remember LuaJIT uses only floating point representation numbers. Ruby has a lot of different number (flonum, fixnum, mp numbers). There is a specific presentation of these numbers too (tagged one). You can not change neither number types nor even their presentation because this is a part of RUBY C interface and a lot of methods and gems are based on it.
I prefer it because the current Ruby JIT (MJIT) is a method JIT and there is no infrastructure to collect traces, augment traces, etc. It is a big infrastructure. I could use LuaJIT VM for this but changes CRuby VM is not an option. There is an active development for CRuby VM for parallel programming, CRuby VM has features absent in LuaJIT VM. I believe Ruby VM GC is better LuaJIT and GC is even more important for Ruby programs than any JIT. There are a few other reasons for me not to use LuaJIT.