Saturday, 29 August 2009

A quick note on IL

  • IL is a CPU-independent machine language created by Microsoft.
  • It is a much higher level language than most CPU machine languages. Its part of the managed module that compiler creates out of source code.
  • It can access and manipulate object types and has instructions to create and initialize objects, call virtual methods on objects, and manipulate array elements directly. It even has instructions to throw and catch exceptions for error handling.
  • IL can be written in Assembly language.
  • Bear in mind that any high level language, most likely, will expose only a subset of facilities provided by the CLR. However, the IL assembly language will expose all the facilities provided by CLR. So, in case you want to use any CLR facility your preferred language doesn't expose you have two options:
    • Use IL to code the desired part
    • Use any other CLR language that exposes the missing facility.
  • This is an amazing feature provided by the CLR where you can use specialized language to perform a specific task in your project. Often overlooked, but wouldn't it be great to perform normal operations like I/O in C#/VB.Net and leverage APL for engineering calculations?

No comments: