← Back to context

Comment by kyberias

3 years ago

What does Just In Time mean for an interpreter?

Compiling to machine instructions and then executing the compiled output, instead of executing the AST directly.

  • That's a just-in-time compiler.

    • An interpreter with a JIT compiler is able to do more optimizations because it has the runtime context to make decisions, while a AOT (ahead of time) compiler will not know anything about what happens at runtime.

      This is why some JIT'd languages (like Javascript) can be sometimes faster than C.

      8 replies →

I think in this case that it executes the code as it's being parsed, in a single pass.