
We will start with how a code written for .net works.
Firstly any code written for .net that supports .net is known as managed code. The managed code is compiled into MSIL(Microsoft Intermidiate Language) code or simply intermidiate language(IL) which is said to be platform independent .The IL code is then compiled to native language code with the help of CLR and JIT.
This IL code can be ported to any other platform in this form it is known as portable code and then it can be compiled into native code with the help of CLR and JIT.
JIT(Just in Time) :- JIT compiles the IL code into native with the help of CLR .This JIT helps CLR in compiling the code step by step or simply as much asked by the program and the resultant of the compiled program is stored which only gets destroyed when the application terminates.
CLR(Common Language Runtime) :-It compiles the IL code into native code or machine readable form with the help of JIT.
The basic need of JIT in CLR is to compile code part by part and not all at a time thereby decreasing the time to to start an application .
CTS(Commaon Type System):- .NET is said to language independent platform. But to do so the language must obey the rules specified by CTS and CLS .
The CTS defines the predefined data types that are available, so that all the languages targeting .net produce compiled code. It understands the data types defined by all the languages tartgeting .net and maps it to .net defined datatype.
eg. visual basic defines 32 bit signed integer as Integer while C# defines defines it as Int32 so to understand the code written in one language by other CTS works.
CLS(Common Language System):-The CLS works with CTS to ensure language interoperability. It defines the minimum standard that all the compiler must follow while targeting .net.All the compiler don't need to write code to support all .net features.
No comments:
Post a Comment