.Net Framework and Common Language Runtime

The .Net framework is software framework platform developed by Microsoft. The .Net which is pronounced as dot net is a software tool that provides tools and technologies that needed to develop windows applications, web applications and web services.

Microsoft’s .Net framework is an ultimate platform which helps us to develop the following applications.

  • Windows Form Applications
  • Windows Console Applications
  • Web Applications

The .Net framework supports more than 75 programming languages. It has mainly two components:

  • Common Language Runtime (CLR)
  • .Net framework class library

Common Language Runtime (CLR)

The CLR or Common Language Runtime is the major component of .Net framework. It is an execution environment which stands as a layer between the Operating Systems and the applications which are coded in .Net programming languages using the benefit of CLS.

  • The main feature of Common Language Runtime is to execute the program after converting the managed code into the native code.
  • The Common Language Runtime (CLR) ‘s JIT (Just In Time) compilation converts Intermediate Language (MSIL) to native code as it is needed at the application run time.
  • The CLR serves the following: manages the memory, thread execution,garbage collection,exception handling, Common Type System (CTS) and code safety verifications during the program execution.
  • Use of delegates instead of function pointers for increased type safety and security using Common Type System.

Common Language Specification (CLS)

CLS which means Common Language Specification is a property of .Net framework which helps to combine the codes written in different .Net framework languages together.

There may be situations in which the objects of two different languages needed to communicate, in this case, the CLS ensures the complete interoperability among applications, regardless of the language used to create the application.

Common Type System (CTS)

The Common Type System or simply CTS is a standard in .Net framework which specifies how the type definitions and specific values of types are represented in computer memory.

It ensures the sharing pieces of information of programs written in different programming languages.

Major functions of Common Type System are:

  • To establish a framework that helps enable cross-language integration, type safety, and high performance code execution.
  • To provide an object-oriented model that supports the complete implementation of many programming languages. To define rules that languages must follow, which helps ensure that objects written in different languages can interact with each other.
  • The CTS also defines the rules that ensures that the data types of objects written in various languages are able to interact with each other.
  • The CTS also specifies the rules for type visibility and access to the members of a type, i.e. the CTS establishes the rules by which assemblies form scope for a type, and the Common Language Runtime enforces the visibility rules.
  • The CTS defines the rules governing type inheritance, virtual methods and object lifetime.
  • Languages supported by .NET can implement all or some common data types.

Read more: Wikipedia