[MUD-Dev] Re: Bruce Sterling on Virtual Community goals

Niklas Elmqvist d97elm at dtek.chalmers.se
Tue Oct 20 11:58:27 New Zealand Daylight Time 1998


On Mon, 19 Oct 1998, Jon Leonard wrote:

> I don't think building a fully featured VM is feasable right away,
> especially if by fully featured we mean every buzzword we can think of.
> Designing a secure, efficient, garbage collected, threaded, distributed,
> capability-based, properly tail recursive (etc.) virtual machine is
> (at least) a serious research project.  It also wouldn't be nearly as
> easy to understand as simple interpreter that fit the same interface.
> 
> That said, I think some sort of byte-code machine makes a lot of sense
> as an option.  Which buzzwords do we want to start with?

Umm, do I get to pick? :) Efficient and garbage collected are two, and
threaded should not be too hard to tack on... And a stack-based VM like
the JVM sounds pretty good.

[snip]

> It's not yet clear what the boundaries should be, either.
> 
> I'm thinking that other modules should present entities (like sockets)
> and functions that operate on them (like write string to).  From the
> object-oriented viewpoint, the operations are methods on these entites.
> 
> It looks like any such system needs to have functions (and callbacks),
> and these are functions of more than one argument.  Is there anything
> else that needs to go in the interface layer?  Unique IDs?
> 
> Left to my own devices, I'd implement these calls as C functions.
> Each module would have a structure listing the names of the functions
> it exported and function pointers.  The structure might include stuff
> about calling conventions, a documentation string, etc.  In my current
> server, all functions take and return linked lists of arguments/results,
> but that's not necessarily the best choice.

Or you could implement this in C++, and you'd be doing some things a
little different. I'm not about to start a religious language war here
(hopefully), but I think the O-O nature of C++ lends itself perfectly to
an object-oriented environment such as a MUD. When I did my first server
effort in C, I found myself writing object-oriented C code most of the
time :)

This project (which actually strikes a chord for me), sounds in some
aspects very similar to my own pet project. Why not use a dynamic loading
scheme in conjunction with C++? Conceptually, we would view the modules as
objects which support a few basic operations.  The individual modules
would then be inherited versions of class Module with redefined
functionality. New modules could be cleanly and easily be dynamically
loaded from a shared lib, allocated by a factory function in the lib, and
then added to the executable without ever having to restart it, much less
recompile it. Using this scheme (it's called "external inheritance"), we
would get true drop-in modules which can be whipped together and added to
the running MUD without having to touch the server code at all. 

Since the individual modules have no way of knowing which other modules
are present in the system, we would also need a decoupled way of passing
information between them. One way of doing this would be to have some kind
of message chain which the modules could connect to and listen on.  Any
messages which are sent on this path can be intercepted and handled by
modules on the path (the modules could be ordered by priority, allowing us
to put default handlers at the very end (=lowest priority) of the chain).

Of course, there is always the matter of having an adequate interface for 
the Module base class, and this is something which needs to be discussed
in depth.

> We might need to have (compile time option?) more than one calling
> convention, and certain modules might use backdoor entry points
> into other modules for efficiency.
> 
> > I'm game.  :)  
> 
> Cool.

I'm definitely ready to contribute! Why not build a website, draw some
specifications, do some heavy designing (I'm deeply in favor of OO
analysis & design with UML as the modelling language), create a CVS tree, 
etc?

GNU Mud anyone? 

(In that case, why don't we rename this thread "GNU Mud"? :)

> Jon Leonard

-- Niklas Elmqvist (d97elm at dtek.chalmers.se) ----------------------
  "Nanny Ogg looked under her bed in case there was a man there. 
   Well, you never knew your luck."
		-- Terry Pratchett, Lords and Ladies






More information about the MUD-Dev mailing list