Is there a difference between a compiler and an interpreter?

Asked

Viewed 635 times

8

What’s the big difference between a compiler and an interpreter?

In languages like C, Java is used a compiler, for example in Javascript 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?

1 answer

7


Languages are hardly linked to the use of a compiler, interpreter or Jitter. Implementations yes. Difference between language and compiler. A example of language taken as compiled but has interpreter is C.

Today browsers and most other uses of Javascript actually use a Jitter to get more performance, but it’s not something inherent in JS. It is common for people to classify the Jitting process 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. Interpretation occurs only once, unlike traditional interpretation, so it’s like a compilation on demand and not a classical interpretation.

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

In the future is possible that the JS is compiled for Webassembly, as other languages may be used.

See also. And differences.

  • In the case of front-end javascript, Chrome V8 or moziila spidermonkey are JIT @bigown?

  • 1

    @Lucascosta Sim.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.