http://c9x.me/compile/
Getting it to generate machine code is almost trivial. Porting it to ARM is only reasonably complicated. It is *very* fast. I will refactor it a bit and work more on it starting mid-september. Feel free to join the force. On Sat, Jun 18, 2016 at 10:33:23AM +0100, Connor Lane Smith wrote: > 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