"Alan Chen" <alan / digikata.com> wrote in message
news:20021218233003.GA4285 / digikata.com...

> What I'm curious about is that if you use a VM don't you still have to
> make sure the VM is distributed? What is the comparative size of a given
> VM vs interpreter?

OCaml's standardlib and GC engine enters at 200K for the native code
compiled version. This is small enough that each dll you create can have
it's own VM (if you can call it VM) - this is useful for creating COM
components and similar.

The bytecode version needs only the OCamlRun.dll which is 100K in size and
the bytecode is rather small. This figure then grows with additional
extensions being used - these can be compiled into the bytecode if there is
no C code involved.
Thus the distribution is limited to a single dll, which is better (much
better) than most non VM applications you'll find. And even C typically
requires a runtime dll for malloc etc.

It wouldn't be a far cry to wrap the bytecode up with the runtime dll,
actually I think you can already do this by making your own runtime (there's
a tool). However, it's better to have the runtime separated out because the
bytecode is then platform independent.

I actually tried to deploy such a solution in a pre-release production test
environment - although only as a prototype for the final politically correct
C++ solution.

So I'd say it certainly is possible to have a VM in distribution - also
without bloated .NET and Java runtimes.
A Ruby VM would probably have to be somewhat larger than OCamls but up to
1MB would easily be acceptable. I think Ruby's current runtime is not very
large actually - and exerb does pull a nice stunt at wrapping it up -
although I have yet to experiment with it.

For distibution purposes it doesn't really matter if it is xor'ed sourcecode
or bytecode. Exerb is close to a real solution, but it's windows only and it
ought to be supported directly in the Ruby core development. It should also
support creating dynamic "packages" such that you don't have to ship, say,
FxRuby with every piece of code.

Mikkel