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

Add build.zig #377

Open iacore opened 7 months ago

iacore commented 7 months ago

This will make this repo a Zig package.

TODO

vnmakarov commented 7 months ago

I am not well familiar with ZIG (I only read common description of the language and I liked it). I have no time check that this will build mir by zig but I trust you and I am not against to include this PR into repository if/when you finish this.

iacore commented 7 months ago

As of Zig 0.11.0, putting build.zig in this repo is not much useful.

I noticed that when building libmir.a, c2mir/c2mir.c is also included. Why is the file included?

Also, MIR relies on way too much C UB. (this is not a problem in practice.) If you build the project with $CC -fsanitize=undefined you will see where relies on UB.