[virtmach] Definition a virtual machine ?

Francois-Rene Rideau fare@tunes.org
Wed, 17 Nov 1999 18:49:04 +0100

On Wed, Nov 17, 1999 at 11:30:42AM -0600, Joel Jones wrote:
> Well, the conversion to a tree-based intermediate form is just one 
> popular way for JITs to do machine-specific optimizations.
Sure. Conceptually, it's the natural way to go.

> If one is 
> not interested in optimizing, one can produce machine code directly 
> from bytecode (this is the slower and dirtier to implement than 
> interpretation).
Note that this can be done with compressed ASTs, too!
There remains to see which costs less and leads to better code.
It looks like to me that unless your bytecode maps very well to
the target machine, and/or you don't otherwise do any complex tree
transformation, the source bytecode gets in the way.
I lack the experience to give an truly objective answer, though.

> If one has an annotation-guided JIT, like mine or 
> Ana Azevedo's, optimization is done in the compilation to bytecode, 
> and annotations encoding the optimizations are transmitted along with 
> the bytecode.  A simple code-generator can use the bytecodes and the 
> annotations to generate optimizer-style code.
Direct bytecode->nativecode compilation can conceptually be done
by deforesting {bytecode->tree ; tree->nativecode} compilation.
I wonder if anyone explicitly uses deforestation as a way
to produce efficient compilers from higher-level declarative specifications.

This kind of things is what I'd like to do:
have an open compiler (both incrementally specializable and free software),
written in a declarative style (higher-order typed setting, with logic rules
and meta-rules that can be encapsulated into rewrite rules and functions),
in which "virtual machines" stay as just artefacts for ease of open
compiler development, that get optimized out by a deforestation process,
except for a few, dynamically negotiated ones, that are chosen to minimize
overall resource usage among participants, including translation processes.
But I admit I've been mostly going in circles with my ramblings,
as shows by eternally lagging TUNES project.

Best regards,

[ "Faré" | VN: Уng-Vû Bân | Join the TUNES project!   http://www.tunes.org/  ]
[ FR: François-René Rideau | TUNES is a Useful, Nevertheless Expedient System ]
[ Reflection&Cybernethics  | Project for  a Free Reflective  Computing System ]
To converse at the distance of the Indes by means of sympathetic contrivances
may be as natural to future times as to us is a literary correspondence.
		-- Joseph Glanvill, 1661