| ▲ | itriednfaild 8 hours ago | |
I've been a low level C and C++ programmer for 30 years. Even with your explanation and having read the webpage twice I have no idea what this technology does or how it works. So it takes normal interpreted code and jits it somehow? But you have to modify the source code of your program in some way? | ||
| ▲ | hencq 8 hours ago | parent | next [-] | |
I think the website does an amazing job explaining it, but it basically takes an interpreter written in C and turns it into a JIT with minimal changes to the code of the interpreter (i.e. not to the code of the program you're running in the interpreter). For example they took the Lua interpreter and with minimal changes were able to turn it into a JIT, which runs Lua programs about 2x faster. | ||
| ▲ | vkazanov 4 hours ago | parent | prev | next [-] | |
tracing jits are slightly harder to grasp than usual ones. The technique comes from real CPUs so the mindset of people behind the original idea is very different from the software world. Metatracing ones are kind of an interesting twist on the original idea. > So it takes normal interpreted code and jits it somehow? Anyway, they use a patched LLVM to JIT-compile not just interpreted code but the main loop of the bytecode interpreter. Like, the C implementation itself. > But you have to modify the source code of your program in some way? Generally speaking, this is not normally the goal. All JIT-s try to support as much of the target language as possible. Some JIT-s do limit the subset of features supported. | ||
| ▲ | fuhsnn 8 hours ago | parent | prev [-] | |
I don't fully grasp it either, the most appropriate analogy I can think of is like how OpenMP turns #pragma annotated loops into multi-threading, this work turns bytecode interpreting loops into JIT VM. | ||