Is there a difference between a compiler and an interpreter?

What is the big difference between a compiler and an interpreter?

In languages like C, Java is used a compiler, while in JavaScript for example an interpreter is used, but I was confronted with the term JIT (just in time compiler).

How can I classify JavaScript processing in this specific case?

Author: Maniero, 2017-03-15

1 answers

Languages are hardly tied to using a compiler, interpreter or JITter . implementations yes. difference between language and compiler . An example of a compiled language with an interpreter is C .

Today browsers and most other uses of JavaScript actually use a JITter for more performance, but it's not something inherent in JS. It is common for people to classify the process of JITting as an interpretation. In fact the case of JS this occurs even because it has to read the source to generate the native code, in other cases it can read only an intermediate representation. The interpretation takes place only once, different from the traditional interpretation, so it is like an on-demand compilation and not a classical interpretation.

In the past JS was fully interpreted and there are still implementations like this, although practically considered obsolete.

In the future it is possible that JS will be compiled to WebAssembly, as well as other languages can be used.

See also . And differences .

 6
Author: Maniero, 2020-05-07 17:00:52