is the CLR?
is runtime environment provided by Microsoft with .net framework to make
development process easier. Code we develop with CLR is called managed code
stand for Common Language Runtime.
is set of resources provided by Microsoft:
2. Type system
3. All .NET base classes
4. Many .NET framework classes
5. Development, debugging, and profiling tools
6. Execution and code management
7. IL-to-native translators and optimizers
2. Cross-language exception handling
3. Cross-language integration
4. Enhanced security
5. Versioning and deployment support
6. Debugging and profiling services
7. Support for custom attributes
8. A simplified model for component interaction
9. Garbage Collection
10. Use of delegates instead increases type safety and security instead
of function pointers.
11. Language features such as inheritance, interfaces, and overloading
for object-oriented programming
are the CTS?
type system check how types are declared ,used and managed in common
language run time.
standardize types for cross-language integration.
stands for Common type system
CTS performs following functions:
Enable cross-language integration, type safety, and high-performance code
2. Provide OOPs model for multiple language implementation.
3. Defines rules that all languages follow it, which helps ensure that objects
written in different Languages can interact with each other.
4. provides a library that contains the primitive data types (such as Boolean,
Byte, Char, Int32, and UInt64) used in application development.
is the range of types that the .NET run time understands, and
therefore that .NET applications can use.. The CTS is a super set of
the CLS(Common language specification).
of int variable in VB converted into int32 in C#, System.int class ensures that
What is the CLS?
CLS is nothing but set of guideless
provided by Microsoft that language to follow so that it can communicate with
other .NET languages in a seamless manner. It was always a dream of Microsoft
to unite all different languages in to one umbrella and CLS is one-step towards
CLS stands for common language
CLS rules helps to enhance and ensure
Better understanding with Example:
CTS are base library which contains
all type information like int32, int64, Boolean etc.
For example CLR understands only type
int32 type, CLS guidelines maps two different languages types(C# int and VB
integer) into int32.
For example common helper class for
database application written in C# and database application written in VB and
declared following variable.
Dim roleId As Integer
Same variable now you can declare in
C# helper class.
public int roleId;
Compiler reads the associated base type of
int(C# Integer in VB) is Int32 from CLS guidelines and convert it to Int32.
What is IL?
MSIL stands for Microsoft Intermediate
Language. We can call it as Intermediate Language (IL) or Common Intermediate
A.NET programming language (C#,
VB.NET, J# etc.) does not compile into executable code; instead it compiles
into an intermediate code called Microsoft Intermediate Language (MSIL).
During the compile time, the compiler convert the source code into
Microsoft Intermediate Language (MSIL) .MSIL is a CPU-independent set of
instructions that can be efficiently converted to the native code.
MSIL TO JIT:
During the runtime the CLR Just In Time (JIT) compiler converts the
Microsoft Intermediate Language (MSIL) code into native code to the Operating System.
When a compiler produces Microsoft Intermediate Language (MSIL), it also
produces Metadata. The Microsoft Intermediate Language (MSIL) and Metadata are
contained in a portable executable (PE) file .
Microsoft Intermediate Language (MSIL)
includes instructions for loading, storing, initializing, and calling methods
on objects, as well as instructions for arithmetic and logical operations,
control flow, direct memory access, exception handling, and other operations
Just In Time Compiler
The computer's processor executes the