Intermediate Language

The Java language introduced the concept of byte code. The evolution of programming languages dictates that some things survive and some don't. Hopefully, the good ideas are propagated and the bad ones are not.

Intermediate Language , or IL, is similar to the idea of Java byte code. If the compiled form of a programming language is general enough, the compiled code can be separated from the platform on which it runs. The idea behind Java is that the compiler creates byte code, and some other tool converts the byte code to a platform-specific version of the code that runs on that specific platform. These other tools are often referred to as JITters , from the abbreviation for JIT compilers. (JIT is an acronym for just-in-time, as in just-in-time compilation.)

There is a good chance that someone, right now, is creating a JITter to convert VB .NET IL code to run on a Linux or UNIX platform.

One of the things we can do with IL is snoop around and look at what the VB compiler does with our source code. More than just being curious , it is possible to emit IL dynamically in VB .NET. This means we can define new types after our VB .NET source code is compiled, at runtime. (I wonder if the ability to emit IL and define new types dynamically will have applications in artificial intelligence, too.) Chapter 4 demonstrates how to emit IL at runtime.

A program that ships with .NET is the ildasm.exe utility, whose name derives from what the tool does: ildasm is an IL disassembler. This utility allows you to open an assembly ”a compiled .NET application ”and look at the IL code written by the compiler. Figure 1.3 (page 12) shows the box instruction automatically emitted by the compiler.

A good learning aid is to discover or explore what our precursors have done or are doing. You can find the ildasm utility in the C:\Program Files\Microsoft Visual Studio .NET\FrameworkSDK\Bin\ folder of the Visual Studio .NET application.



Visual Basic. NET Power Coding
Visual Basic(R) .NET Power Coding
ISBN: 0672324075
EAN: 2147483647
Year: 2005
Pages: 215
Authors: Paul Kimmel

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