Intermediate compiling

Niklas Elmqvist <>
10 Nov 1996 15:45:31 -0500

          From comp.compilers

Related articles
Intermediate compiling (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 (Julian Highfield) (1996-11-18)
| List of all articles for this month |

From: Niklas Elmqvist <>
Newsgroups: comp.compilers
Date: 10 Nov 1996 15:45:31 -0500
Organization: Algonet
Keywords: interpreter, performance, question

I'm implementing a rather interesting MUD engine that will support a
catch language which will allow for rather advanced features. The catch
is installed on game objects (such as rooms, mobiles and items), and
trigger whenever a certain action takes place. Below is an example of
the code (installed on a mobile named 'man'):
@GIVE $if (env_is("stone")) $then {
pay(me, 100)
(Triggers whenever someone GIVEs something to man, checks environment if
it is a stone, cheers if that is the case and pays the invoker (me) 100
gold pieces.)

The problem is that parsing this (the text string) during run-time is
not very efficient (i.e. slow). We got pointed in the direction of
compiling the catches into some pseudo-binary code, i.e. code that is
very fast for the MUD to read (a bunch of byte opcodes), but which is
not true binary code.

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.

/Niklas Elmqvist <>
[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]


Post a followup to this message

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