Is C# partially interpreted or really compiled?

后端 未结 13 1122
别跟我提以往
别跟我提以往 2020-12-07 11:51

There is a lot of contradicting information about this. While some say C# is compiled (as it is compiled into IL and then to native code when run), others say it\'s interpre

13条回答
  •  情话喂你
    2020-12-07 12:33

    Most languages, if not all, requires an interpreter that translates their scripts to machine codes in order to allow the cpu to understand and execute it!

    Each language handles the translation process differently!

    For example, "AutoIt" is what we can describe as being a 100% interpreted language!

    why?

    Because "AutoIt" interpreter is constantly needed while its script is being executed! See example below:

    Loop, 1000
    Any-Code
    

    "AutoIt" interpreter would have to translate "Any-Code" 1000 times to machine code, which automatically makes "AutoIt" a slow language!

    In the other hand, C# handles the translation process differently, C#'s interpreter is required only once, before script execution, after that it is not required anymore during script execution!

    C#'s interpreter would have to translate "Any-Code" only once to machine code, which automatically makes "C#" a fast language!

    So basically,

    • A language that requires its interpreter during script execution is an "Interpreted Language"!

    • A language that requires its interpreter only once (before script execution) is a "Compiled Language"!

    Finally,

    • "AutoIt" is an "Interpreted Language"!

    • "C#" is a "Compiled Language"!

提交回复
热议问题