+ 9
How C# source code is compiled?
6 odpowiedzi
+ 8
C# source code is compiled in thefollowing steps:
1. First, the code is compiled into Microsoft Intermediate Language
2. When the app executes, another compiler(just-in time compiler) in the CLR translates the MSIL in into machine-language code
(for a particular platform)
3. The machine-language code executes on that platform
+ 7
Compiled into an intermediate language (IL) like byte code which in turn is interpreted or JIT compiled by a Common Language Runtime into native machine code for execution.
+ 3
Using C# compiler to generate native code 🤔
+ 1
JIT (just in time) or AOT (ahead of time) - both is possible.
+ 1
1.your code is compile by c# compiler and it convert into MSIL(Microsoft intermediate language).
2.Then this compiled code is go in CLR(common language runtime) which provide all types of namespace and frameworks to your compiled programme.in CLR there is JIT(just in time compiler) which again recompile your code into machine code and show you result.
The main advantage of MSIL is that you can transfer this MSIL to other persons or friend something so they can compile this code again with the help of JIT.
Mainly when you share your programme with the other which is written in c# we share our MSIL code.
0
Depends on the compiler and its configuration, for example:
1. In DotNet core, it will get converted to intermediate language code and will be JIT compiled for the required platform runtime,
2. Also, you get the option to publish it directly to machine code for a particular platform.
3. In case of Unity3D C# compiler, the code gets converted to C++ code and then compiled to machine code(IL2CPP)
So, it depends on the compiler you use and the configration you use it in.