4 ms·
I'm almost positive that LLVM provides both. You always target LLVM bytecode with your frontend, but then you can choose either to: - run the bytecode using t
by maximilian 17y ago
I'm almost positive that LLVM provides both. You always target LLVM bytecode with your frontend, but then you can choose either to:
- run the bytecode using the LLVM with or without JIT.
- compile the LLVM bytecode into x86 bytecode.
This is what clang does (afaik) and is a reasonably nice use case because you write a static language that targets LLVM bytecode and end with a fast program because LLVM will output optimized x86 binaries.
However, I'm pretty sure that the efforts like unladen swallow attempt to use the LLVM's virtual machine in the hope that it will become very fast as they optimize it (especially the JIT part).
- nostrademons 17y agoYeah, you just instantiate an ExecutionEngine and feed it your LLVM bytecode, and it'll give you back C function pointers that you can call. The ExecutionEngine is either a JIT (which'll compile your bytecode into native code and give you that back) or it's an interpreter (where the function pointer you get back is an entry point into the interpreter).
- foldr 17y agoOk, my mistake, sorry.