compiler-constructionjitdynamic-compilation

What is the difference between Just-in-time compilation and dynamic compilation?


Specifically, wikipedia states that "JIT compilation is a form of dynamic compilation, [...]"[1]. But aren't these two terms simply synonyms? What is the difference between the two?

Are there any examples of dynamic compilation that aren't also JIT compilation? Or failing that, are there cases where the term dynamic compilation is more fitting than JIT compilation?

Both terms seem to refer to performing compilation at runtime. Both terms seem to describe from-source as well as bytecode compilation. Both terms seem to cover run-time optimizations.

My own impression is that JIT compilation is a term that became popular because that was what the dynamic compilation in the Java VM was called. This concept gained in popularity, and other program runtimes started copying it, calling it by the same name, JIT compilation. Dynamic compilation seems to be a term that predates that development, and is mostly found in older scientific publications.


Solution

  • Admittedly, Wikipedia is confusing. First it says:

    just-in-time (JIT) compilation, also known as dynamic translation...

    Then it says:

    JIT compilation is a form of dynamic compilation, and allows adaptive optimization such as dynamic recompilation...

    This also suggests that dynamic translation is also a form of dynamic compilation, which does not make much sense.

    The term dynamic compilation used the be the standard and only term to refer to the family of techniques of compiling code at run-time before 1995. For example, check out this paper from 1985 that discusses dynamic compilation for Prolog. Many pre-1995 papers can be easily found that use the term.

    However, the Java programming language was released around 1995 and the Java documents are first to use the term JIT compilation or JIT compilers. The earliest such document that I could find is this, although the first Java JIT compiler was developed in 1996. I've seen many papers published in that time frame that use the two terms interchangeably.

    I remember also that some papers I've read consider JIT compilation a type of dynamic compilation.