Page 15 - Open Soource Technologies 304.indd
P. 15

Modern Programming Tools & Techniques-III



                      Notes
                                                                    Figure 1.2: CLR




































                                    Source: http://dotnetslackers.com/articles/sql/Introduction-to-CLR-Database-Objects.aspx
                                    1.3.2 Managed Execution

                                    The .NET CLR provides a common context within which all .NET applications execute, regardless
                                    of the language in which they are written. CLR is responsible for handling every aspects of the
                                    managed code such as memory and resource management, secure environment to run in, garbage
                                    collection , access to the operating systems services etc. Code that targets the CLR is commonly
                                    known as managed code. The managed execution process includes the following steps:
                                    1.   Choosing a proper compiler
                                    2.   Generating MSIL code
                                    3.   Compiling MSIL to CPU specific native code using JIT
                                    4.   Executing the processor specific code.
                                    Every constructs (such as class, struct, etc. ) in every .NET languages must compile to CLR
                                    compatible types to qualify as .NET managed code. You can choose compilers such as Visual
                                    Basic, C#, Visual C++, JScript, or one of many third-party compilers like Eiffel, Perl, or COBOL
                                    compiler. CLR supports a wide variety of data types and language features. It is not mandatory
                                    to include all the CLR features in every .NET enabled languages, but the exposed language
                                    features should be compatible with the standard .NET frame work. If your component is targeted
                                    to use by components written in other .NET languages, your component’s exported types must
                                    expose only language features that are included in the Common Language Specification (CLS).

                                    1.3.3 Microsoft Intermediate Language (MSIL)

                                    MSIL Code Generation is the first level of .NET compilation in which the high-level compiled in
                                    to a language called Intermediate Language (IL). The IL code look more like machine code than




            8                                LOVELY PROFESSIONAL UNIVERSITY
   10   11   12   13   14   15   16   17   18   19   20