Microsoft Intermediate Language

   

As you can see in Figure 24.1, all .NET code, regardless of the language syntax used, compiles to Intermediate Language (IL) code. IL code is the only code the CLR understands; it doesn't understand C#, Visual Basic, or any other developer syntax. It's IL that gives .NET its multilanguage capabilities; as long as an original source language can be compiled to IL, it can become a .NET language. For example, people are developing a .NET compiler for COBOL ”a mainframe language with a long history. This compiler will take existing COBOL code and compile it to IL so that it will run within the .NET Framework using the CLR. COBOL itself isn't a Windows language and doesn't support many of the features found in a true Windows language (such as a Windows Forms engine), so you can imagine the excitement of COBOL programmers at the prospect of being able to leverage their existing code and programming skills to create powerful Windows applications.

Figure 24.1. These are the steps taken to turn developer code into a running component.

graphics/24fig01.gof


graphics/bookpencil.gif

One of the potential drawbacks of IL is that it may be susceptible to reverse compilation. This has many people questioning the security of .NET code and the security of the .NET Framework, in general. If code security is a serious concern for you, I encourage you to research this matter on your own.

graphics/newterm.gif

IL code isn't the final step in the process of compiling and running an application. For a processor (CPU) to execute programmed instructions, those instructions must be in machine-language format. When you run a .NET application, a just-in-time compiler (called a JITter ) compiles the IL to machine-language instructions that the processor can understand. IL code is processor independent, which again brings up the possibility that JITters could be built to create machine code for computers that are using something other than Intel-compatible processors. If Microsoft were to offer a CLR for operating systems other than Windows, much of the differences would lie in the way IL would be compiled by the JITter.

As .NET evolves, changes made to the CLR will benefit all .NET applications. For example, if Microsoft finds a way to further increase the speed at which forms are drawn to the screen by making improvements to the CLR, all .NET applications will immediately benefit from the improvement. Optimizations made to a specific syntax compiler, such as the one that compiles C# code to IL, are language specific, however. This means that even though all .NET languages compile to IL code and use the CLR, it's possible for one language to have small advantages over another because of the way in which the language's code is compiled to IL.


   
Top


Sams Teach Yourself C# in 24 Hours
Sams Teach Yourself Visual Basic 2010 in 24 Hours Complete Starter Kit (Sams Teach Yourself -- Hours)
ISBN: 0672331136
EAN: 2147483647
Year: 2002
Pages: 253
Authors: James Foxall

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net