vnmakarov / mir

A lightweight JIT compiler based on MIR (Medium Internal Representation) and C11 JIT compiler and interpreter based on MIR
MIT License
2.24k stars 145 forks source link
aarch64 apple c compiler intermediate-representation interpreter jit-compiler linux m1 macos ppc64 riscv64 s390x x86-64

GitHub MIR test status GitHub MIR test status on Apple Silicon GitHub MIR test status on aarch64 GitHub MIR test status on ppc64le GitHub MIR test status on s390x GitHub MIR test status on riscv64 GitHub MIR benchmark status

MIR Project

Disclaimer

MIR

MIR Example

Running MIR code

Running binary MIR files on Linux through binfmt_misc

The mir-bin-run binary is prepared to be used from binfmt_misc with the following line (example):

line=:mir:M::MIR::/usr/local/bin/mir-bin-run:P
echo $line > /proc/sys/fs/binfmt_misc/register

Do adapt the mir-bin-run binary path to your system, that is the default one

And run with

c2m your-file.c -o your-file
chmod +x your-file
./your-file your args

The executable is "configurable" with environment variables:

Due to the tied nature of mir-bin-run with binfmt_misc, it may be a bit weird to call mir-bin-run directly. The P flag on the binfmt_misc passes an extra argument with the full path to the MIR binary.

The current state of MIR project

Current MIR

The possible future state of MIR project

Future MIR

MIR JIT compiler

C to MIR translation

Structure of the project code

Playing with current MIR project code

Current MIR Performance Data

Current C2MIR Performance Data

MIR project competitors

Porting MIR