Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is C# code compiled to native binaries?

I know that Java code is compiled into byte-code, that is executed by the JVM.

What is the case with C# ? I have noticed that applications written in C# have the .exe extension what would suggest they are native machine instructions. but is it really so ?

like image 769
Queequeg Avatar asked Sep 25 '12 13:09

Queequeg


People also ask

What is this C language?

C is a structured, procedural programming language that has been widely used both for operating systems and applications and that has had a wide following in the academic community. Many versions of UNIX-based operating systems are written in C.

What is '~' in C language?

In mathematics, the tilde often represents approximation, especially when used in duplicate, and is sometimes called the "equivalency sign." In regular expressions, the tilde is used as an operator in pattern matching, and in C programming, it is used as a bitwise operator representing a unary negation (i.e., "bitwise ...

Is C and C+ Same?

While both C and C++ may sound similar, their features and usage are different. C is a procedural programming language and does not support objects and classes. C++ is an enhanced version of C programming with object-oriented programming support.

Why C is called?

After language 'B', Dennis Ritchie came up with another language which was based upon 'B'. As in alphabets B is followed by C and hence he called this language as 'C'.


2 Answers

No.

Like Java, C# is compiled to an intermediary language (called MSIL or CIL).

Unlike Java, the IL is stored in EXE files which have enough actual EXE code to show a dialog box asking users to install .Net.

like image 117
SLaks Avatar answered Oct 12 '22 11:10

SLaks


C# compilation is done in these two steps :

1. Conversion from C# to CIL by the C# compiler

2. Conversion from CIL to instructions that the processor can execute.

A component (just in time) performs this compilation at run time from CIL to machine code

like image 33
A Developer Avatar answered Oct 12 '22 12:10

A Developer