vnmakarov/mir
FreeA lightweight JIT compiler based on MIR (Medium Internal Representation) and C11 JIT compiler and interpreter based on MIR
About vnmakarov/mir
MIR (Medium Internal Representation) is an open-source, lightweight JIT compiler framework developed by Vladimir Makarov. It provides a strongly typed intermediate representation that can represent machine instructions for 32-bit and 64-bit architectures. The project includes a C11 JIT compiler and interpreter, a C-to-MIR compiler (c2mir), an LLVM-to-MIR converter (llvm2mir), and a MIR-to-C converter (mir2c). MIR is designed to be a basis for implementing fast and lightweight JIT compilers, with initial plans to target CRuby and MRuby. It currently supports x86_64, aarch64, ppc64le, s390x, and riscv64 platforms on Linux and macOS. The code is written in C and is available under the MIT license.
Key Features
Pros & Cons
- Lightweight and fast JIT framework suitable for embedding
- Open source under permissive MIT license
- Supports multiple modern CPU architectures
- Includes both an interpreter and a JIT compiler for flexibility
- Well-documented with detailed MIR specification and API guides
- Provides converters from C and LLVM IR, easing adoption
- Limited platform support: only tested on x86_64, aarch64, ppc64le, s390x, riscv64 Linux/macOS
- Early-stage project with disclaimer of no warranty and limited testing
- Not widely adopted yet; community and ecosystem are small
- Requires understanding of low-level IR and JIT concepts to use effectively