The Virtual Machine Machine and the Virtual Virtual Machine

(sorry for posting this drivel from my own backlog of notes. i'm pretty ill at the moment, and don't have time to do any better. there are some good things in the works though -- a whole slew of nifty projects just kicking off)

That drunk steve yegge was muttering onstage about languages, and said something that raised an obvious idea in my mind:

Virtual machines are great for language interoperability. If everybody in the world used [the language D, for example], you probably wouldn't need a virtual machine. You'd probably still want one eventually, because of the just-in-time compilers, and all the runtime information they can get.

But by and large, we don't all use D. In fact, we probably don't all use the same five languages in this room. And so the VM, whether it's the CLR, or the Java VM, or Parrot, or whatever... it provides a way for us to interoperate.

Although he weakens his own point by mentioning these competing VMs (CLR, JVM, Parrot) -- this slip up makes me wonder: can a VVM be created? A Virtual Virtual Machine -- that acts as a layer between languages and virtual machines, and allows higher level code to be translated onto any virtual machine.

Dawn of computer age

We write:
Machine Code

Compilers invented...

thank you gracie!

We write:

Code, compiled to
Machine Code

Currently...

We write:

Code, compiled to
VM code, jitted to
Machine code

Future?

We write:

Code, compiled to
VVM code, zapped into
VM code, jitted to
Machine code

Or instead we could intercept between the Virtual and Physical tiers with a Virtual Machine Machine --

We write:

Code, compiled to
VM code, jitted to
VMM code, swizzled down to
Machine code

So the full five tier infrastructure would be:

We write:

Code, compiled to
VVM code, zapped onto
VM code, jitted to
VMM code, swizzled down to
Machine code

The opportunities for optimization would be endless! (or.... just hopeless)

 

My book "Choose Your First Product" is available now.

It gives you 4 easy steps to find and validate a humble product idea.

Learn more.

(By the way, I read every comment and often respond.)

Your comment, please?

Your Name
Your Url (optional)
Note: I may edit, reuse or delete your comment. Don't be mean.