Re: Intermediate compiling

dgay@barnowl.CS.Berkeley.EDU (David Gay)
12 Nov 1996 22:06:25 -0500

          From comp.compilers

Related articles
Intermediate compiling croziys@algonet.se (Niklas Elmqvist) (1996-11-10)
Re: Intermediate compiling kuznetso@MIT.EDU (1996-11-12)
Re: Intermediate compiling dgay@barnowl.CS.Berkeley.EDU (1996-11-12)
Re: Intermediate compiling J.C.Highfield@maybeso.demon.co.uk (Julian Highfield) (1996-11-18)
| List of all articles for this month |
From: dgay@barnowl.CS.Berkeley.EDU (David Gay)
Newsgroups: comp.compilers
Date: 12 Nov 1996 22:06:25 -0500
Organization: chaos
References: 96-11-068
Keywords: interpreter, performance

Niklas Elmqvist <croziys@algonet.se> writes:
      Is this a good way to do it? Does anyone have any information on how to
      implement this, or any other, better, way? Maybe just some pointers to
      good information resources in this field (preferably on the Internet)?
      Any help is welcome.


Languages for MUDs are basically like any other language, so all the
usual techniques apply. Generating bytecodes is probably a best first
step, as you get decent performance for not much effort. You can
always change this later, if you start having a lot of scripts...


      [Unless you have the world's most enormous MUD, it's hard to believe that
      the interpreter overhead will be noticable. People write huge scripts in
      TCL which reinterprets all the source all the time and the performance is
      fine. Indeed, you should consider using TCL rather than writing yet
      another extension language. -John]


Actually, our experience suggests otherwise. The problem is that while
the overhead of any particular script is indeed likely to be
negligeable, you will (if the language is successful) have many of
these scripts. Last I checked, on our mud the extension language was
accouting for 1/3 of the cpu usage, and we generate SPARC object code
(we have more lines of code in the extension language than in the base
C code for the mud).


But the advice about reusing an existing language is good (though I
would personally avoid TCL because it will be hard to do something if
the performance becomes a problem). If I was starting from scratch, I
would go for some dialect of Scheme (you can find lots of public
domain interpreters, compilers, etc).
--
David Gay - Yet Another Starving Grad Student
dgay@cs.berkeley.edu
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.