The Java virtual machine (JVM) is not alone in the world. Microsoft decided that it could do the JVM one better with its .Net environment. While larger, .Net is far from an open system. Its core virtual machine (VM) and primary programming language, C# (pronounced C sharp), is an ECMA (European Computer Manufacturer Association) standard (www.ecma.ch).
As with Java, a plethora of acronyms describes the various technologies in ECMA-335. Some common ones are shown in the table. CIL is the machine code for the VM. Surprisingly, the specification never mentions a VM but describes it in excruciating detail.
The VM differs in intent from Java because it is designed to support a wide range of programming languages, from Visual Basic to Eiffel. The CLS provides the glue to hold the architecture together so that a C# program can seamlessly use objects from programs written in other languages, such as J# or possibly Cobol.
The VM's design is much more complex than a JVM because the CLI must handle legacy applications written in languages like C++. It does this by dividing applications into managed (like C#) and unmanaged (like C++) code. Developers can write managed code in C++.
Managed and unmanaged code deal with memory usage. Garbage collection supports managed code, while unrestricted pointers are in the unmanaged code realm. Garbage collection makes C# architecturally closer to Java than C++, but its syntax is closer to C++.
Microsoft has a shared-source version of its VM for noncommercial use. The VM is also available on non-Windows platforms. Check out Ximian's (www.ximian.com) Mono project for an open-source version of the ECMA-335 platform and more.
COMMONALITY | |
CIL | Common Intermediate Language |
CLI | Common Language Infrastructure |
CLS | Common Language Specification |
CTS | Common Type System |