Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is JIT compiler a Compiler or Interpreter?

My question is whether JIT compiler which converts the IL to Machine language is exactly a compiler or an interpreter.

One more question : Is HTML, JavaScript a compiled language or interpreted language?

Thanks in Advance

like image 425
Ananth Avatar asked Feb 22 '11 04:02

Ananth


People also ask

Is JIT same as interpreter?

Interpreter is a program that translates the programmer written instructions or scripts into corresponding machine code that matches a particular hardware platform of a CPU. On the other hand, JIT is a compiler that translates bytecodes into machine codes at runtime. It requires CPU time and memory.

Why is JIT faster than interpreter?

The JIT-compiled code is actually running directly on the bare metal whereas interpreted code has to be continually reinterpreted by the interpreter. The interpreter is no longer having to reprocess and reprocess the byte code.

What is the difference between JIT compiler and normal compiler?

A compiler compiles (translates) the given program to executable code (whole code at a time). A JIT compiler performs a similar task but it is used by JVM internally, to translate the hotspots in the byte code. A compiler compiles (translates) the given program to executable code (whole code at a time).

Is JIT slower than interpreter?

Since the runtime has control over the compilation, like interpreted bytecode, it can run in a secure sandbox. Compilers from bytecode to machine code are easier to write, because the portable bytecode compiler has already done much of the work. JIT code generally offers far better performance than interpreters.


1 Answers

JIT (just in time) compiler is a compiler. It does optimizations as well as compiling to machine code. (and even called a compiler)

HTML, Javascript are interpreted, they are read as-is by the web browser, and run with minimal bug fixes and optimizations.

like image 104
Yochai Timmer Avatar answered Sep 29 '22 21:09

Yochai Timmer