Hi all, I was wondering if others had an opinion on JIT. Suppose we don't need anything fancy like adaptive optimisation, but just wanted to compile a program at runtime. One possibility might be to generate C code and store that in a file and then call the C compiler and then execute the resulting binary... But that seems a bit unpleasant, prone to compilation failure, and not particularly lightweight either.
One solution could be simply to produce assembly code, but then that is tied to a specific architecture, which is unfortunate. There's also LLVM, but that is a very big and complicated dependency, which shouldn't really be necessary if we're just jitting something quickly and don't mind it being a little unoptimised for the sake of simplicity and speed of compilation. We just want to portably generate machine code and then run it. An ideal might be something like an abstract instruction set together with a JIT for the abstract machine. To be honest a JIT might not even be necessary so long as it is has very little interpretation overhead, the instruction set is general purpose and fixed, and it plays well with the C memory model. Does anyone have any ideas? Thanks, cls