← Back to context

Comment by userbinator

3 years ago

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.

    • The correct term for this is "JIT compiler."

      (JIT interpreter is not a phrase I'm familiar with.)

      You can also have an optimizing JIT compiler. Or further, a profiling JIT compiler.

    • Can you give some simple example for the folks in the back of how JIT'd languages can be faster than C? I think most people are under the impression that statically compiled languages are "always faster."

      6 replies →