Red Hat Developer's MIR Is A Lightweight JIT Compiler
Not to be confused with Ubuntu's Mir display stack or Rustlang's MIR, the new MIR effort by Red Hat developer Vladimir Makarov is a new project focused on providing a lightweight JIT compiler.
MIR in this context is the Medium Internal Representation (Rustlang's is the Mid-Level Internal Representation) and is striving to be a lighter-weight JIT compiler than the JIT interfaces offered by GCC or LLVM.
Initially, MIR is aiming to suit the just-in-time needs of CRuby and/or MRuby and from there expand out. This IR is strongly-typed, based on the concept of modules, and you can get to MIR through LLVM IR as one of the options.
In the future the hope is that not only LLVM IR could feed into MIR but also WebAssembly (WASM), Java Bytecode, CIL, and others intermediate languages/representations. Ultimately from MIR one could go to machine code for all the popular architectures or also back out to C code, WASM, or Java bytecode. The ambitions are similar to that of LLVM IR with many different inputs and outputs.
Besides GCC and LLVM JIT'ing being big, their compilation speed for some use-cases is considered too slow and can be difficult incorporating new optimization passes.
While MIR is still in the early stages of development, there is a lengthy write-up on the Red Hat Developers blog about this new effort. The MIR code is currently being developed via this GitHub repository. This should be a fun compiler project to watch in 2020 and hopefully beyond.
MIR in this context is the Medium Internal Representation (Rustlang's is the Mid-Level Internal Representation) and is striving to be a lighter-weight JIT compiler than the JIT interfaces offered by GCC or LLVM.
Initially, MIR is aiming to suit the just-in-time needs of CRuby and/or MRuby and from there expand out. This IR is strongly-typed, based on the concept of modules, and you can get to MIR through LLVM IR as one of the options.
In the future the hope is that not only LLVM IR could feed into MIR but also WebAssembly (WASM), Java Bytecode, CIL, and others intermediate languages/representations. Ultimately from MIR one could go to machine code for all the popular architectures or also back out to C code, WASM, or Java bytecode. The ambitions are similar to that of LLVM IR with many different inputs and outputs.
Besides GCC and LLVM JIT'ing being big, their compilation speed for some use-cases is considered too slow and can be difficult incorporating new optimization passes.
While MIR is still in the early stages of development, there is a lengthy write-up on the Red Hat Developers blog about this new effort. The MIR code is currently being developed via this GitHub repository. This should be a fun compiler project to watch in 2020 and hopefully beyond.
11 Comments