I built a compiler that generates intermediate representation code but I don’t have enough time to create a backend myself. Can anyone recommend existing tools or interpreters that can run this type of intermediate code? Where can I find and download such tools?
llvm is a solid choice for ir, it works great with custom stuff. qemu could work too, but might need some adjusting. both are free - check their websites for download.
Your IR looks pretty straightforward to work with. I hit a similar wall when building a custom language compiler - ended up just writing a simple Python interpreter instead of wrestling with existing tools. Since you’ve got explicit variable assignments and basic control flow, implementing it shouldn’t be too bad. Just build a basic interpreter with a symbol table for variables and handle gotos with a simple jump table. I got way more control over debugging and adding features this way versus trying to shoehorn my IR into something like LLVM that expects totally different formats. Honestly, writing your own interpreter might be faster than all the integration headaches.
Nice IR format! What made you go with explicit val assignments like that? And what’s your compiler targeting - something specific or general purpose? Knowing your use case would help people suggest better backend options.