[virtmach] life signals..
Michal Gajda <firstname.lastname@example.org>
Tue, 29 May 2001 09:07:41 +0200 (CEST)
On Thu, 10 May 2001, rastasman wrote:
> 1-what's kylix?
It's Borland's Delphi port on Linux platform.
> 2-stack-machine with 2 registers vs. unlimited registers (better known
> as RAM:).
> what approach do you think that is better for :
> a- a teorical model for a real VM
> b- one VM that can use better resources from different architectures
Somebody cited his professor saying that "optimal number of registers is
either 0 or infinity". At least from the point of view of compiler VM.
If I was going to do sophisticated JIT compiler(with register allocator
and spilling), then I would choose infinite number of registers model (to
efficiently use real machine's registers.
[But it would be slower -> see answer 3]
If I was going to keep VM simple, then I would do with stack machine
(rather add third stack, than use these 2 registers, unless these 2
registers are some special application) design. Good idea used in some
fast VMs I've seen is to use some usual (return address,data)stacks, frame
stack and frame pointer(if you retain closures, then FP need not always
point inside the frame stack) to allow quick access to local variables.
The advantage of stack machine is more straightforward translation of
usual expression-based language.
> 3-JustInTime VM vs. traditional VM. To me, JIT VM seems very like a
> but, without an JIT VM is there any form to use real computer registers
> map VM registers? is possible to make parallel processing in a JIT VM?
Yes, but as JIT must operate on runtime it must be fast and can use
optimization opportunities not seen statically(so specialize the code
towards in some ways).
[Strictly speaking JIT and traditional is difference between VM
*implementations* not specifications. So you can first make traditional
one, and then go for JIT, if you need more speed]
Traditional VM written in C can enforce using real computer register for
your VM register by using "register" keyword. [In any other language you
shall count on compiler's register allocator]
Example of parallel VM could be pABC machine(parallel graph reduction
machine used as intermediate language for functional language Clean).
[Would you really implement either MIMD or SIMD parallel VM,
I would be grateful to read about :-)]
> 4-I was coding one parser (bottom-up , LR Grammars I think) that uses
> tables to fit different grammars (any grammar that can be defined using
> BNF maybe)
> in real time, it's coded in C++. I made it for my future VM (not yet
> designed, it's for
> a game). It's not finished but if anyone wants to play with it (or use
> it) , I could post
> the sourcecode.
If you mean "in real time" as at the runtime(so that at the runtime you
generate grammar from BNF description) then yes, I am very interested.