Is the CLR a Virtual Machine?

Is the CLR a Virtual Machine?

A reader recently asked me if the CLR is a Virtual Machine or not. An interesting question that comes up frequently enough that I think it is worth addressing here.I asked around the usual suspects on the CLR team and got some of their impressions.

As you may know we typically refer to the CLR as an Execution Engine rather than a virtual machine.Some of the motivation to use the term Execution Engine was because at the time we shipped V1.0, the term Virtual Machine was most commonly used to refer to Java’s VM, even though there is a long history of other Virtual Machines.Now there are a large number of terms various folks are using to refer to environments such as Java and the CLR:VM, EE, VEE, MRE and MRTE and even a conference dedicated to the topic.

Now, the term Virtual Machine has come to be a general term that describes abstract execution environments such as the CLR, the JVM, the Smalltalk VM, etc.The term “virtual machine” is really a much older term from the hardware world (IBM’s virtualization of the 360 was the first, I believe, in the 1960s) that used to mean a software/hardware emulation of the underlying machine to accomplish the same sort of stuff that Microsoft does with VirtualPC .However the term Execution Engine refers to the implementation of a completely different machine (an “IL Machine” on top of an x86).That’s the same thing the Pascal PMachine did (PCode on top of lots of hardware) for example… and it is the same thing both the CLR and the JVM do.

So the bottom line is that the CLR and JVM are in the same class whether you call that class of software “virtual machines” “execution engines” depends on your perspective.