[virtmach] Implementing VMs efficiently

btanksley@hifn.com btanksley@hifn.com
Wed, 2 Feb 2000 16:37:58 -0800


> From: Peter_Murray@allegiance.com.au

> I feel that methods of dynamic optization seem to be blurring the line
> between the virtual machine and the compiler.

Interesting way of putting it.

> I've long wondered if it would be worthwile distributing a 
> compressed and
> possibly encrypted intermediate representation of a program 
> along with, or
> instead or, the byte-codes.  This should enable better 
> optimisation since
> the optimizer theoretically would have a better idea of the 
> "intent" of the
> application.

SlimBinaries for Oberon (AKA 'Juice') have been doing that for a long time.
There's no need for bytecodes, and the resulting binary is far smaller than
compressed bytecodes or source.  There's also no need for a huge 'validator'
program which is responsible for checking type safety; it's literally
impossible to encode a type unsafe operation.

(Although in the case of Juice, this "impossibility" is unproven; it wasn't
a priority.  There's a project underway to impliment a proven save version
at http://caesar.ics.uci.edu/laski/portablecode.html; so far they've
developed a C++ parser for SlimBinaries, thus providing a semiformal
specification for Slimbinaries which wasn't available before.)

Personally, I think bytecodes are a staggeringly bad idea for most VM use;
they take too much space and carry too little information.  The only place
they're reasonable is in constrained memory (where there's not enough room
to unpack a slimBinary).

-Billy