.NET Framework and Programming Languages

I like programming languages. I have used quite a number of them over the years, and I still use many different languages on a regular basis. A recent article in Infoworld suggests that programmers need to expand their language horizons. I agree, because I think that different types of problems lend themselves to different programming languages.

I have been doing some programming recently with Microsoft’s .NET framework. For those who aren’t familiar with the .NET Framework, it is a complete departure from the Microsoft’s former WIN32 programming model. Similar to Java in some ways, it is composed of two parts: the Base Class Library (BCL) and the Common Language Runtime (CLR). The Base Class Library is similar in concept to the C runtime library, only much larger in scope. The Common Language Runtime is an implementation of the Common Language Infrastructure (CLI) standard. It handles tasks such as memory management and exception handling and also runs bytecode called the Common Intermediate Language (CIL), formerly known as MSIL (Microsoft Intermediate Language). The bytecode is compiled using a just-in time (JIT) compiler. (This strikes me as far too many acronyms.) This is a simplified view of the whole architecture; there are many quirks and nuances involved, but this is the general idea.

The Common Library Runtime is actually a virtual machine, and the Common Intermediate Language is a type of assembly language for this virtual machine. The just-in-time compilation means that your code is compiled on the fly into your processor’s machine language. This means that anyone could (in theory) target a different processor just by writing a new just-in-time compiler to run your existing code. Currently, code does work without change on both 32-bit and 64-bit versions of Windows.

There are many programming languages available for the .NET Framework. Visual Studio comes with C#, Visual Basic .NET, and C++/CLI (which is a version of C++). You can download F# (a variant of ML) for free from Microsoft and F# will be an official Visual Studio language in the future. A quick search shows that other languages available for the .NET framework include Pascal, COBOL, APL, Lisp, Forth, Ada, Python, Prolog, Smalltalk, Haskell, Eiffel, and Ruby, among others. I’m sure that all of the versions of those languages are not equally usable, but they are available.

Because all of the .NET languages use the same Base Class Library, you can combine different programming languages in ways that weren’t possible before (at least in Windows). You can even use a decompiling utility such as Reflector to convert compiled programs from one language to another. Perhaps we are moving to a future when a programmer can pick the best programming language for a problem, instead of being limited to one or two choices.

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2007-2024 by Matthew Reed, all rights reserved.
ContactPrivacy Policy