[DGD] Precompiling LPC to C

Petter Nyström md1pette at mdstud.chalmers.se
Sat Jun 10 13:40:02 CEST 2006


Hello list!

I have a piece of code in my mudlib that I worry about, performance wise. 
What it does is that it parses the output for each user that it is sent 
to. Output is basically parsed for expanding macro sequences and doing 
linebreaking. An output string can for example look like this.

"$recg(</std/obj/player#123>,10) $verb(\"smile\",</std/obj/player#123>) happily."

The different macros is then expanded by the output parser, to display 
name, description or pronoun and correct verb form depending on how the 
receiver relates to the macro attributes. There is more to the parser, but 
I think this is more than enough for what I actually want to ask about.

Now, for my question. How would I go about if I wanted to precompile my 
LPC code for this into C, and link it with DGD? I read that this is 
possible, but I can't seem to find any documentation as how to do it.

On the ftp site I find a few packages that can supposedly help 
precompiling LPC to C. But I must confess that these scare me too. Also, 
it seems their main selling point is to help with sorting out 
dependencies. I would probably implement my parser as a single LPC object 
without any inherited objects other than the auto object. Would these 
packages still be useful?

And finally, how does it work once you have your code linked with the 
driver? Can I "compile" and call that object as if it was still a normal 
LPC program? I am just very fuzzy on this whole thing. =)

All pointers, hints and comments are much welcome!

Regards,

Jimorie



More information about the DGD mailing list