In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "what is the difference between compilation and interpretation in programming". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Differences: 1. Compilation translates the source program into executable object code; the interpreter does not produce object code. 2. The interpreter can be used across platforms, and the cross-platform of the compiler is not good. 3. The interpreter can be modified at any time and take effect immediately; the compiler is not good. 4. the running efficiency of the interpreter is low, and the execution speed of the compiler is fast.
The operating environment of this tutorial: windows10 system, Dell G3 computer.
Compilation translates the source program into executable object code, translation and execution are separated, while interpretation completes the translation and execution of the source program at one time, and does not generate storable object code. This is only an appearance, and the biggest difference between the two is that for interpretation execution, the control of the program runtime is in the interpreter, not in the user program; for compilation and execution, the control of the runtime is in the user program.
Interpretation has good dynamic characteristics and portability, such as dynamically changing the type of variables, modifying the program and inserting good debugging diagnostic information into the program during interpretation and execution. if the interpreter is transplanted to different systems, the program can run on the system on which the interpreter is transplanted. At the same time, the interpreter also has great shortcomings, such as low execution efficiency and large space, because not only the user program has to be allocated space, but also the interpreter itself takes up valuable system resources.
The compiler compiles every statement of the source program into a machine language and saves it as a binary file, so that the computer can run the program directly in the machine language at run time.
On the other hand, the interpreter is only when the program is executed, it is interpreted as a machine language for the computer to execute, so the running speed is not as fast as the compiled program.
The difference between compilation and interpretation:
1. Different from the way computers communicate.
The interpreter does not produce object code, it takes out the statements in the source program one by one, interprets and executes them; the interpreter interprets the source code files into machine language and gives them to CPU for execution.
Compilation is to translate the source program into executable object code and execute executable program files. Translation and execution are separate.
2. Different operating environment
The interpreter can be used across platforms, because the interpreter has done the interactive processing for different platforms, the user-written source code no longer needs to consider differences, and all platforms can execute the source code directly.
Compiler cross-platform is not good, different operating systems, call the underlying machine instructions are different, need to generate different machine code files for different platforms.
3. Convenience of development
The interpreter can be modified at any time and take effect immediately. After changing the source code, run it directly to see the effect.
Every time the compiler modifies the source code, it recompiles to generate the machine code file.
4. Running speed
The running efficiency of the interpreter is low, and all the code needs to be interpreted and executed by the interpreter, which is much slower than the compiled type.
The compiler is fast because your code has been translated into a machine language that the computer can understand.
This is the end of the content of "what's the difference between compilation and interpretation in programming". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.