[virtmach] I am new here ...
Sergei Lodyagin
virtmach@iecc.com
Mon, 24 Dec 2001 12:44:51 +0200
OK. Here I've tried explain my design decisions.
1. For what it is?
VM it is slightly overloaded term, or, more correctly, there are
different applications in
which VMs are used. I suppose that VM is a tool which allow describe
program in
some common operations (or definitions) to allow its automatic
transmission and running in
any environment where this VM is running.
2. Why neither bytecode nor AST.
Well, bytecode is a term I've never seen a complete definition. When
people say "bytecode"
the first association is a stack-based virtual machine. This machine is
a very simple for
implementation and it can be managed by very small set of operations ( <
256 - all of them can
be coded as 1 byte). It is a very popular methods becouse, as already
was mentioned,
it is very simple.
But one will have problems when will try translate such program for a
real machine - processor.
The problems is a complexity of obtaining information needed for
high-quality optimization from
this intermediate representation. (May be it is a good topic for
discussion).
The author of Juice make the same conclusion.
He suggests use an intermediate compiler representation - Abstract
Syntax Tree (others propose
use for the same purposes quards etc.). It seams to me that this
approach is good for build
high optimized code, but it is very tied with a source language (for
Slim Binaries it is Oberon),
it makes an execution part very expensive (becouse it is a good part of
a whole compiler)
and it doesn't allow interpret the code.
3. The real problem is not VM, the real problem is an environment.
There is a fashion include in VM specification some uniform operation
system superstructure
to allow VM interreact with resources, other components of software
(written in another languages) etc.
It seams to me that good design should make a border between these two
different things.
My approach is: the VM code shouldn't be a user of resources but one of
the resources for using.
4. VM should have possibility to present a generic code.
Generic means not instantiated (it is Ada terminology, C++ programmers
use the term "template").
It seams to me that VM can give a power to this conception (sometimes
they name it
"static inheritance"). Only VM based models allow use generic code by
the most natural
way - instantiate it with different parameters "on fly".
Well, I don't like very long letters (especially the letters which are
full of my poor language :( ).
May be I miss some important topics. If you show interest in it I will
write a bit more.
Sergei Lodyagin.
> On Sat, 22 Dec 2001, Sergei Lodyagin wrote:
>
>> If you like you can see on my project - http://quirks-uvm.sf.net .
>> It is my experiment. It is VM which is neither bytecode (like Java and
>> its company) nor AST (like Juice).
>> Also I constantly search for new links, different comparisons and
>> other stuff about VMs. It will be good if sometimes this information
>> will appear in this list.
>
>
> Well, to get things moving a little bit, why don't you tell us a bit
> about your VM design and why you went away from bytecode, ASTs etc?
> (I know you have stuff at your website, doing it here may spark some
> discussions..)
>
> niall
>
>