[Others] Compiled language, interpreted language, stupidly confused, what is JIT?

High-level programming languages ​​are divided into two types according to the execution method of the program, one is a compiled language and the other is an interpreted language.

compiled language

The compiled language will translate the source code into machine code at one time through the compiler and then execute it. Generally, the execution speed of the compiled language is relatively fast . The common compiled languages ​​​​are C, C++, etc.

interpreted language

An interpreted language will interpret the source code sentence by sentence into machine code and execute it through an interpreter. Generally, the development efficiency of an interpreted language is relatively high . Common interpreted languages ​​include Python, JavaScript, etc.

It can be found that whether it is a compiled language or an interpreted language, the source code is compiled into machine code before execution. The difference is that one is compiled before execution , and the other is dynamically interpreted during execution , so why must it be translated into machine code before execution?

Because computers can only directly recognize and execute specific instruction sets, these instruction sets are machine codes, and the source code is essentially just some text. Only when translated into machine codes can it be regarded as an instruction or program. In order to combine the advantages of the two types, the development Just- in -time compilation (JIT) allows compilation and interpretation to coexist. Like a compiled language, it first compiles the source code into bytecode, and then translates the bytecode directly during execution, and then executes it.

Guess you like

Origin blog.csdn.net/weixin_43918614/article/details/123976096