You are on page 1of 5

Programming Languges:

-Platform Dependent (C, CPP, Cobol, Pascal etc.,)

Source Code -> Compile -> Machine Code (.exe)
-If machine code is generated on an OS we can run it only on that OS.

-Platform In-dependent (Java, .Net Lang's)

Java Source Code -> Compile -> Byte Code
Byte Code -> JVM -> OS Specific Machine Code

.Net Lang's Source Code -> Compile -> IL Code

IL Code -> CLR -> OS Specific Machine Code

Note:Byte Code & IL Code can run on different OS's

.Net: it is a product of Microsoft designed to be Platform Independent (Portable)
which can be used in the development of various kinds of application like:
-Desktop Applications
-Character User Interfaces
-Graphical User Interfaces
-Web Applications
-Mobile Applications

-To develop the different kinds of application we are provided with various things
under .Net as following:

1. Languages: C#.Net, VB.Net,Cobol.Net, VCPP.Net, J#.Net, F#.Net, Pascal.Net,

Fotran.Net etc.,
2. Technologies: ADO.Net, ASP.Net
3. Servers: Windows 2008 Server (OS), Sql Server (Database), IIS (Web Server),
Share Point Server, BizTalk Server.
Language Interoperability or Independency:
-As .Net is a collection of languages programmers are given an option of developing
their applications using any language of their choice, but each and every language
uses a seperate language compiler for program compilation.

-A program that is written using a .Net Language once after compilation generates
IL Code and if at all the same program is written using different .Net languages
and compiled they also will generate the same IL Code so we call this IL Code as
CIL Code (Common Intermediate Language).

C#.Net -> CSC -> CIL Code

VB.Net -> VBC -> CIL Code
J#.Net -> JSC -> CIL Code

-All object oriented programming languages provide re-usability of code but only
with in that language only where as .Net Lang's provide cross language re-usability
of CIL Code i.e. the CIL Code generated from one .Net language can be re-used from
any other .Net language in the future and we call this as language interoperability
or independency.

C# Program -> Compile -> CIL Code -> Re-use in any

.Net Lang Program

VB Program -> Compile -> CIL Code -> Re-use in

any .Net Lang Program
.Net Framework:
-It is a software which masks the functionalities of an OS and executes .Net Lang's
compiled IL Code under it's control providing the features like:
-Portability (Platform Indepedency)
-Automatic Memory Management

-If we wanted to run the IL Code on any machine it is must to install .Net
Framework on that machine.

-In case of platform dependent languages like C, CPP, etc., the compiled code
(Machine Code) runs directly under OS.

Note: the code which runs under the Framework is known as managed code and the code
which runs under ths OS is know as un-managed code where managed code provides
various features like portability, security, automatic memory mgmt etc.
Development of .Net Framework:
-Microsoft has started the developement of .Net Framework in late 90's originally
under the name NGWS (Next Generation Windows Systems).

-To develop the framework first a set of spec's have been prepared known as CLI
Specifications (Common Language Infrastructure).

-CLI Spec's are open spec's standardized under ISO (International Standards
Organization) and ECMA (European Computers Manufacturers Association).

-CLI Spec's talks about 4 important things like:

1. CLS (Common Language Specification)
2. CTS (Common Type System)
3. BCL (Base Class Library)
4. VES (Virtual Execution System) or CLR (Common Language Runtime)
Common Language Specification:
-It is a set of base rules all the .Net lang's has to adopt to interoperate with
other, most importantly after compilation of any .Net lang program should give the
same output i.e. CIL Code.

Common Type System:

-According to this all language of .Net has to adopt uniform data type structure
i.e. similar data types must be same in size in all lang's of .Net, so that if any
2 languages wants to communicate with each other size problems will not come with
data types.

-As most of the .Net lang's are extension to some existing languages like Cobol.Net
extension to Cobol, VB.Net extension to VB etc., the data type names will be
different from lanaguage to language but even if names are different similar types
will be uniform in size.

-Any data type that is used in any .Net lang once after compilation gets converted
into IL Types as following:

-So in IL Format all data types will be same. When we want to consume the code of a
language from other languages the data types of first lang are converted into IL
Types and presented to second lang as its understandable data types only as
Note: CLS & CTS are the foundation for language independency or interoperability of
.Net Lang's.

3. Base Class Library:

-A library is a set of re-usable functionalities where each and every programming
language has built in libraries to it, like header files in C, CPP; packages in
Java etc.

-Same as the above .Net lang's are also provided with built in libraries known as
BCL. The speciality of these libraries is they can be consumed under any .Net lang
as following:

Note: BCL are the best example for language interoperability because the libraries
have been developed in C# language and can be consume from any .Net Language.

4. Virtual Exectuion System (VES) or Common Language Runtime (CLR):

CIL Code -> VES or CLR -> Windows Machine Code

CIL Code -> VES or CLR -> Linux Machine Code

CIL Code -> VES or CLR -> MAC Machine Code
-Adopting the CLI Specifications Microsoft has implemented .Net Framework for
Windows but not for any other OS's, where as CLI Specifications are open so 3rd
party vendors like MONO came forward and implemented the .Net Frameworks for few
other OS's like Unix, Linux, Sun-Solaris, Apple-MAC etc.
C#.Net -> CSC -> CIL Code
int Int32
float Single
bool Boolean

VB.Net -> VBC -> CIL Code

Integer Int32
e Single
Boolean Boolean
Common Language Runtime (CLR):
-Memory Management
-Runtime Error Handling

1. Security Manager
2. Class Loader
3. JIT Compiler
4. Garbage Collector
5. Exception Manager

-Manual or Explicit
-Automatic or Implicit

Line 1:
Line 10: string str = "Hello";
Line 100: WriteLine(str);
Line 101:
Line 1000: