Common language Infrastructure and its components

Common language infrastructure(CLI) is Microsoft’s defined guidelines which is approved by ISO and ECMA that explain and at the same time ensure codes of various high-level languages can be executed on any operating systems to achieve platform independent feature in .NET supported languages.

cli

That’s the reason why C# or .Net Framework languages are independent from computer hardware, however, the .NET design is not.  Mono( software that is used for developing a cross-platform application) helped some extent by providing support on Linux and other OSs.

CLI just not only provides the environment to execute your code independently but also allows the communication among two distinct and completely different programming language which helps the developers from the headache of rewriting the code.

So, CLI has the following components that work together:-

Common type System: 

The one which is responsible for providing the framework to use two or more languages together. It defines how types are declared and managed in a source code of any .NET language in the CLR( common language runtime where your bytecode or portable execution file turned into machine code). It also provides the OOPs model which enables  implementation of various high-level languages. It defines rules that must be followed, so that ,objects of different language can communicate with each other and provides the primitive data type libraries.

Informative stuff related CTS:

  1. Types in .NET:  In .NET, a type can be value type (represent actual value ) and reference type(similar to pointer). .NET framework supports these types Classes, Structures, Enumeration, Interfaces, and Delegates.
  2. Type Definition: It includes attribute(variable), types name, visibility, and base type.
  3. Type Members: We have attributes and to make them behave, we have type Members such as field, methods, constructors and more.
  4. Characteristics of type members:  Type members (methods ) can have various characteristics such as abstract, private, family and more). It’s not important that all the characteristics should belong to each and every type members.

Common Language specification

It is a subset of Common type system.CLI represents some commonality among the languages, these commonalities are used to achieve interoperability as its libraries developed in such a way that every language can directly use it.

Metadata(data about data)

It gives information about the program structure which includes classes and its members, embedded with intermediate language( instruction generated by the compiler in .NET).

Virtual Execution System

A runtime system which executes managed code( code generated in .NET).

Leave a Reply