Virtual machines and usage thereof

I don’t personally have many opinions on virtual machines. Java runs on virtual
machines for portability reasons, but suffers in that compiled code cannot be
run without a virtual machine. They claim that in any case virtual machines are
approximately as fast as native binaries. Microsoft have also decided to build
the .net platform on a virtual machine.

On the contrary, many other compiled languages are compiled to native binaries.
To run on a platform, they must be compiled to support it (whether this means
using an Arm instruction set or a more generic target such as i386).

Another question that pops up is why are Java and .net run-time environments not
always installed by default on all operating systems? Obviously .net not being
open source or directly supporting linux is a part of the problem — and why
Mono is under development, but only a part. Both Java and .net run-time
environments are far more than simply virtual machines — they also include many
libraries, for host-specific functionality, language-specific functionality,
and many other features. Because of their size and complexity, they tend to be
updated continuously with the usual assortment of bug-fixes and new features
too.

Virtual machines without the bloat

So what’s wrong with separating the virtual machine and support libraries from
one another?

OK, so first up, a target platform (whether CPU or virtual machine) without any
libraries is going to be pretty difficult to do anything with. Most languages
also provide a moderate to (at least in the case of Java) huge selection of
core libraries which are guaranteed to be present. Since the Java and .net
virtual machines are targetted at specific (sets of) languages with their own
core libraries, it’s not surprising that they are bundled with their own
libraries.

Even if a virtual machine was developed in isolation from all computer languages
and therefore had no associated core libraries, as soon as someone wants to use
it they are going to need a bunch of libraries coming from some language or
other. How does cross-architecture communication on a single CPU work? Again,
I don’t have much of an idea, but I expect overheads are high enough that at
least the most frequently called functions should be available on the same
architecture. Perhaps less performance critical libraries could be used across
architectures, but my point is really that architecture-specific libraries are
going to be needed and there should be an easy way to install them (whether
via system repositories or user-space installers), but such libraries should
not be considered a part of the virtual machine itself. In this way, it should
be possible to have a virtual machine installed by default on every machine
(and preferably updated and distributed by the maintainers of that platform,
whether Microsoft, Apple, Debian, Canonical, or another developer), bundled, if
the maintainer wishes, with core libraries associated with that platform and
whatever languages are commonly used for its development, but not requiring
the distribution of other libraries or any other large set of data coming from
the virtual-machine developer or any other developer beside that of the
target platform.

I’m not saying we need another virtual machine or that someone should
develop one, but rather that large development environments comprising
languages, large sets of libraries, and associated virtual-machines don’t make
sense (unless you’re trying to lock users into a single platform). Virtual
machines and languages should each make their own stands, as should libraries
going much beyond the basics expected of any language.

Advertisements

About dhardy

A software developer who landed in Switzerland, I love conjecturing over a few things computer-related, open collaboration, and quietly promoting linux/KDE as a desktop OS.
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s