C # whether the language is compiled or interpreted

Source: Internet
Author: User

Here we need to discuss whether C # Is a compilation language or an interpretation language? It will be discussed from the definition and described in the flowchart. I hope the conclusion will be helpful to you.

I did not give a detailed definition to these two concepts. It is obvious that the two concepts are difficult to define accurately.
. H (B & W0 ^! N "v,''} 2 T + J in the book <> (by michaei L. Scott), I found related definitions and descriptions. The excerpt is as follows: Compilation and interpretation
, Z + T-D; U2 T # l "W2 o-xOne of the advanced languagesProgramThe compilation and execution of is probably the following:* P6 T + T2 C # s

The compiler transfers the advanced language fromSource codeTranslate it into an equivalent Target Program (equivalent to translating it from Chinese to Chinese), and then hide it. At a later time, the user starts the target program to be executed by the operating system. Another way to implement advanced languages is to explain: (H "K2 o, @ 9 r

Different from compilation, the interpreter is always running during the execution of the Target Program (in fact there is no target program at all, just compared with the compilation. This execution process is completely controlled by the interpreter. In terms of effect, the interpreter implements a "Virtual Computer", and its "machine language" is a high-level language. The interpreter reads one or more statements at a time, perform the corresponding operations according to the prescribed methods. In general, interpretation is more flexible than compilation; Compilation generally has better performance. However, some languages use a mixture of the two: 8 C7 e # y # Y & H4 X) A4 A, '# A * Y V

The original text in the book: "If the translator in the initial stage is relatively simple, we will say that this language is" interpreted ". If the translator is complex, we can say that the language is "compiled ". The distinction between the two is now somewhat vague, because "simple" and "complicated" are both modifier terms, and it is entirely possible that a compiler (complex translation process) is used to generateCodeAnd then executed by a complex Virtual Machine (Interpreter. In this case, if the translator thoroughly analyzes the program (instead of performing a "mechanical" transformation), and the intermediate language program is not very similar to the source program, we still say that this language is compiled. These two features-thorough analysis and non-trivial Transformations-are the iconic features of the compilation method. "! _ 5 @ * Q3 U .~ * | % C j (T, k' B % [
According to the above standards, CSC only translates C # To Il as a "mechanical", and C # And Il have a strong similarity, because the program code of the two can almost 100% convert each other (for example, reflector can decompile C # Into Il, or decompile il into C #). What do you think?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.