عجفت الغور

how jit compilers are implemented and fast: pypy, luajit, graal, and more

Tags: articles, jit

https://web.archive.org/web/20220430042047/https://carolchen.me/blog/jits-impls/

original (now dead link): https://carolchen.me/blog/jits-impls/

  • Interpreted languages still go down to bytecode
  • Function reuse happens, if you compile multiply(1,2), and then wrote multiply(2,3) then the already compiled version will be used
    • llvm bitcode can be seen
  • jits don’t compile ahead of time, but still compiles source to machine code
    • not strictly about compiling code just-in-time, but compiling optimial code at an optimal time
  • how do we generate optimal code? not all assembly instructions are created equal
    • humans typically write better assemly than a computer
  • jits usually are more expensive but make up in optimized compiled code