Home > Back-end >  Compiled and interpreted languages is the real difference?
Compiled and interpreted languages is the real difference?

Time:09-27

As is known to all, compiled language after a compilation, the corresponding machine code generation platform and packaged into platform can identify the enforceability of the program, but its portability and execution efficiency is for an executable program, good portability and interpreted languages, is the source code for the program, and, obviously, compiled language generated executable program execution efficiency, certainly more than interpreted languages first compiled implementation of high efficiency, therefore, it's hard for me to understand their comparable?

CodePudding user response:

Is the code to the implementation process, of course you can compare


And there's a JIT, instant way to compile the compiler

CodePudding user response:

High efficiency is not necessarily the best,
As if the plane must be faster than bike, why there are so many people don't choose to fly to buy food?

So want to make a choice according to different scenarios, sometimes you will feel better by plane, sometimes you'll feel like riding a bike is better,

Compiled faster than interpreted, but the fast is calculate by millisecond to fast a few milliseconds, human has no sense, so dealing with human interface is usually interpreted, should change to take effect immediately, without waiting for compilation, it interpreted the biggest advantage is free, when something goes wrong also can see the source code,

CodePudding user response:

references for the development of the building Lord Shi Bohui diary reply:
is well known, compiled language after a compilation, the corresponding machine code generation platform and packaged into platform can identify the enforceability of the program, but its portability and execution efficiency is for an executable program, good portability and interpreted languages, is the source code for the program, and, obviously, compiled language generated executable program execution efficiency, certainly more than interpreted languages first compiled implementation of high efficiency, therefore, it's hard for me to understand their comparable?



There are many aspects to compare, such as readability, speed of execution, the length of the programming, terseness, functional language, evolvability, and other language or operating system compatibility, etc.

CodePudding user response:

Has been solved, to explain the following
1. The performance comparison: for a compiled language, it needs to be compiled only once, no longer needs to be compiled from the second start the process, you just need to directly implement the compiled the results; And interpreted languages are different, it needs to explain every time (the equivalent of a compiled language compilation process), after the execution, the execution efficiency of compiled language than interpreted languages,
2. Portability is: suppose a compiled and interpreted languages are all in the source program level, so the two language portability "same" (such as a compiled language source code of the copy on another machine, and then compiled language as interpreted languages, but it is compiled and running), but the reality is often in a compiled language contains a third-party libraries, API, etc., these third-party things usually there is no source code, the introduction of all is the others packed program, so a compiled language in the program under normal circumstances is often difficult to guarantee all the code in the source program on the level of something (a third party can be understood as a machine language level), so a compiled language portability is restricted, and interpreted languages will never appear this kind of circumstance, because it is not to generate an executable program, so its source code is also as an executable program without any involvement, so can easily realize the source program level of transplantation,

CodePudding user response:

Simple image understanding is that the compiler is good code translation, interpretation is to carry a translator's code
Compilation is the interpreter translated code into the corresponding system of binary instructions (translated into his language), each system can quickly according to the instructions (his compatriots can understand instruction), so a degree for fast (his compatriots are executed directly)
Explanation is not translated into the corresponding binary instructions (not translated into other languages), but each execution hire an interpreter to interpret instruction, which is then performed by the system (his countrymen from translators get translation results to execute), because every time need to be translated, so to a certain extent for slow
As for portability, is the same, good translation instruction is not necessarily suitable for another system (translated into other languages is not a common language, look not to understand another country), so get another country people don't understand, can not perform, so there are limitations
And translation type because of execution at any time (i.e., bring a interpreter translated into national language), relatively high flexibility, so as long as can bring different interpreter in each country,

CodePudding user response:

medical hand references 2 floor response:
high efficiency are not necessarily the best,
As if the plane must be faster than bike, why there are so many people don't choose to fly to buy food?

So want to make a choice according to different scenarios, sometimes you will feel better by plane, sometimes you'll feel like riding a bike is better,

Compiled faster than interpreted, but the fast is calculate by millisecond to fast a few milliseconds, human has no sense, so dealing with human interface is usually interpreted, should change to take effect immediately, without waiting for compilation, it interpreted the biggest advantage is free, when something goes wrong also can see the source code,

See large amount is not big, you written in lua device protocol parsing logic and then try to run on the server, high concurrency scenario this difference is very big, what thing is afraid of big, small zha play, freshmen have died,
  • Related