Red Hat Developer's MIR Is A Lightweight JIT Compiler

Written by Michael Larabel in Programming on 20 January 2020 at 07:14 AM EST. 11 Comments
PROGRAMMING
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.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week