a virtual machine
Gilbert Baumann
gilbert@ma2s2.mathematik.uni-karlsruhe.de
Sat, 26 Apr 97 18:09:24 +0200
Marcus Daniels <marcus@sysc.pdx.edu> wrote:
> Not much lip service is being given to the idea of a virtual machine.
> Why not introduce a new target Lispy (virtual) instruction set to
> CMUCL (and/or whatever) and write a portable (perhaps JIT) emulator
> program for various targets?
I like the idea of a virtual machine. In most cases you do not even
need a JIT compiler. We have also some expirences with CLISP. Well,
CLISP is not that fast on fixnum operations. But a few days ago, I
made a speed measurement: I compiled my current project, a web browser
implemented in CL + CLM, with both ACL and CLISP and measured the time
needed for reformating some really large pages. ACL was only faster by
a factor of two. And what is even more important: When I run XEmacs
concurrently and using ACL, the machine starts to swap much sooner eating
all the advantage of compilation to native code. [This was on a PPro
machine with 8MW core running under Linux.]
I believe, that the difference between interpreted byte code and
native code will be the smaller the faster your processor gets. This
is because of the limited bandwidth of nowadays DRAM compared to the
clock speed of the processor. When the byte code interpreter is small
enaugh to fit into the first level cache fetching only a few words a
each couple of cycles you waste less cycles waiting for the data from
the DRAM.
Using a VM would also increase the protability of the project
drastically. And you could have two flavours of the LispOS; the real
thing, where everything is in Lisp and the add on thing running on top
of some other OS.
When porting to a new platform the JIT compiler could be optional the
first time, which should decrease the development time further.
And perhaps debuging the beast would also be much easier using a VM.
However for low level stuff like heavy usage of fixnums or poking
around in but-arrays you need a JIT compiler.