I used to contribute to the project back in v1 days. I'm not sure if the architecture has changed since then, but basically it worked by compiling the game logic as a kind of byte code that got interpreted at run time.
Like on top of the CPU’s opcodes? I imagine you mean the opcodes. That CPU probably can’t handle much abstraction. What impresses me the most is that to get performance out of these games, they’re often very carefully coded in the Sharp/Z80/8080 assembly. This compiler must be quite something.
Yes exactly. It's not a zero cost abstraction, but it's a very simple format, each byte code oppose maps directly to function and passes its args. So it's basically just a conditional jump