- dotTech - http://dottech.org -

The 411 on Process Virtual Machines

Most everyone uses ones of these every day and don’t know it. Some that do know either don’t understand it or, even worse, misunderstand it. Yet if anyone ever ran a Java program or a .NET based program they’ve used one.

At its most basic, a Process Virtual Machine (PVM) is somewhat like the Virtual Machines (think VirtualBox) that run whole operating systems. The main difference between the two being  PVMs only virtualize processes, not whole operating systems. The main idea of a PVM is to simplify the creation of programs as well as making programs easy to use for the end user.

Java and .NET both have their own systems, but the basic idea remains the same: a coder can make a code once and the PVM deals with making it run on different computers.  In Java’s case, this means that a programmer can make one code that will run on Windows, Mac, UNIX, Linux, and even mobile phones.  In the case of .NET, a programmer can target any Windows based device and have the code work with little or no changes. This helps developers target very large groups of people with minimal expense in terms of time and money. Furthermore, PVMs makes programming easier since a lot of things that a programmer normally has to worry about, things they would usually have to code manually, can be easily called instead of created. Continuing on that trend, PVM based programs are also safer since the program is running in a virtual machine, making it harder to mess up the system (though not impossible, trust me, I know =D).

On the flip side not everything is rosy in PVM park. For starters you need to have the PVM installed on your computer, though in the case of .NET if you keep your computer up to date odds are you will have .NET (or, depending on what Windows you have, you may not even need to download it from anywhere because various versions of .NET come with Windows Vista and Win7). If you don’t have the PVM or even the correct version (in general having a new version is ok) the program won’t run.  And the PVM is not always that small – the installer for .NET 3.5 SP1 is 250 MB. PVMs are also controversial. PVMs are considered to be cheating by some since the programmer has the PVM doing a lot of the work for him or her. However, that also hurts the programmer since if something is not in the PVM they have to access native (or non PVM) code to do it, which can be very hard sometimes. Finally, though this is more true with .NET than Java, a PVM program will only run if the PVM is supported on the OS in question.

I personally am a PVM programmer. My “native” programming language is Visual Basic (.NET PVM), but I know Visual C# (.NET PVM), and am in the process of learning Java (Java PVM). I also plan to learn to code natively in the future. Though I admit that using PVMs has some problems, I believe that just because a program uses them doesn’t make them any worse than a program that’s written natively. However, in the end I suppose that’s your call.

[This article has been contributed to dotTech by Samuel [1] with minor edits from Ashraf [2].]