[MUD-Dev] Re: DevMUD: Inheritable modules
Jon A. Lambert
jlsysinc at ix.netcom.com
Sun Nov 1 03:30:38 New Zealand Daylight Time 1998
On 1 Nov 98, Thandor wrote:
> On Sat, Oct 31, 1998 at 06:26:05PM +0100, The Arrow wrote:
> > What functionality do we want from the compiler/vm modules?
> > In my own mind, the compiler is just a black box, that wants the name of a
> > file to compile, and returns the compiled code together with a pointer (or a
> > handle or a name) to the VM needed to interpret the code. More or less the
> > same with VMs, you give it a piece of code to interpret, and it returns a
> > succes/failure code.
> I think that explains what I'm talking about. A compiler is obviously going
> to be tied to the VM that interprets it's code. If we have two different
> VMs that both use a different byte code language, then obviously they both
> need a seperate compiler - unless we introduce an intermediate
> representation and have another module that is VM specific handle
> converting this intermediate representation that the compilers produce into
> runable VM code. I personally think the compiler pairs with a single VM is
> a better way - each VM may have multiple compilers, but each compiler only
> targets a single VM.
I don't think this is an obvious restriction at all. For example
there is nothing to tie the Java language to the Java VM. There
are several different compilers that target the Java VM. I've played
with a Basic compiler that compiles to .class files. There's a site
on the web (don't have the link handy) that is dedicated to listing a
number of different language compilers that target the Java VM
and there are quite a few of them, Scheme, Lisp, Ada to name a few.
IMO, The VM should be viewed as just another processor. Our
advantage is that we can define any of the opcodes we think we
need. What are executables but intermediate representations for
your x86 processor (or whatever you're using). This intermediate
representation is vital to any compile now/run later system.
On the other hand, it isn't necessary for interpretors since the
VM and compiler are often rolled into a single tightly coupled unit.
--/*\ Jon A. Lambert - TychoMUD Internet:jlsysinc at ix.netcom.com /*\--
--/*\ Mud Server Developer's Page <http://www.netcom.com/~jlsysinc> /*\--
--/*\ "Everything that deceives may be said to enchant" - Plato /*\--
More information about the MUD-Dev