Step 01 · Why JIT?

Ahead-of-time (AOT) compilation produces a binary at build time. Just-in-time (JIT) compilation defers code generation to run time:

AOTJIT
Compile cost paidonce, off-lineevery invocation (cached after first run)
Knows actual inputsnoyes — can specialise on profile data
Patching live codehardfirst-class (tiering, deopt)
Cold-start latencytinynon-trivial
Deploy artefact.exethe JIT + bytecode/IR

Real-world JITs: HotSpot (Java), V8 (JS), LuaJIT, Julia, Numba, PyPy, Pharo. They share three ingredients:

  1. An IR low enough to lower to machine code (LLVM IR, Sea-of-Nodes, etc.).
  2. A code generator that emits into executable memory.
  3. A symbol table that lets fresh code call previously-jitted code and runtime helpers.

LLVM gives us all three through ORC.