Looking for Backend Tool to Execute Intermediate Code

I built a frontend compiler that generates intermediate representation code, but I don’t have enough time to develop a backend myself.

Does anyone know of existing tools or interpreters that can run this type of intermediate code? Where can I find them?

Here’s what my compiler outputs:

val1 = 1.23456e-5
total = val1

val1 = 5
val2 = 7  
val3 = val1 + val2
counter = val3

START:
    val1 = total
    val2 = 15
    val3 = check(val1 <= val2)
    val4 = total
    val5 = 8
    val6 = check(val4 != val5)
    val7 = val3 OR val6
    val8 = total
    val9 = 15
    val10 = check(val8 > val9)
    val11 = val7 AND val10
    if val11 true jump LOOP else jump END
LOOP:
    val1 = 3
    val2 = total
    val3 = val2 + val1
    total = val3
    
    val1 = 1
    val2 = counter
    val3 = val2 + val1
    counter = val3
    jump START
END:

Any suggestions would be helpful.

Try using an existing VM framework like WebAssembly runtime or build on a simple stack machine. Your intermediate representation looks like three-address code, which works great with bytecode interpreters. I built something similar with a basic C++ interpreter that keeps a symbol table for variables and a jump table for labels. Pattern matching for assignments, arithmetic, and conditional jumps is pretty straightforward. You could also generate assembly code and use an assembler, but that’s more complex. For quick prototyping, a Python interpreter would handle your variable assignments and control flow just fine.

totally! python’s a great fit for that kind of thing. u can use it to eval each line and manipulate vars. it’s super flexible, might save u some time!

This looks really interesting! What made you pick this IR format? Have you thought about writing a simple C interpreter or checking out LLVM IR? Also curious about performance - does it need to be fast or just working for now?