[MUD-Dev] Embedding Python

Todd McKimmey rufus at wombatgames.com
Thu Mar 23 15:18:07 New Zealand Daylight Time 2000


----- Original Message -----
From: <icecube at ihug.co.nz>
To: <mud-dev at kanga.nu>
> On Sat, Feb 12, 2000 at 09:30:17PM +1300, I wrote:
>
> [using Python as an embedded MUD language]
>
> > Stackless Python and microthreads are apparently on the path to
> > integration, but they're not there yet. It looks non-trivial to do
> > especially without knowing the guts of the Python interpreter in detail
> > (which I don't).
>
> There's now a microthreads implementation on top of SP available, although
> I haven't looked at it in detail.
>
> > [1] Python microthreads -- http://world.std.com/~wware/uthread.html

Note: this post may wander a bit off topic, but it's all python/mud related.

Fwiw -- The system I'm currently designing uses standard Python (I've looked
into the microthreads to a minor degree, but haven't explored their full
potential yet) as the scripting language as well as major game components
being written in python. So far development is right on (I had to add some
tricks in code to handle things not always executing in a state other than
immediate, but it was mostly trivial). I wasn't around for the original
discussion, so I'm unsure as to the advantages of standard python and
stackless python, but for what I'm using it for, it's working perfectly, and
the integration of python into c++ (or c for that matter) is dead-on easy.

In fact, the way the system is currently shaping up, 'area files' are
nothing more than python scripts. This came out of my disdain for writing
yet ANOTHER text parser, even though I've abstracted all the file parsing
tools I've written in the last 3 years into neat little libraries. It was
just much easier to let python do everything for me. It has a few neat side
effects. For me, who comes from a background of doing all data-base MUD
stuff in ascii format, it's a much faster way to load things (I did a load
test the other day with 10,000 rooms and it loaded, after it compiled to
byte code, in just under 6 seconds). In fact, all data files are merely
python scripts, which allows things such as single functions to be run out
of a playerfile without having to have any sort of textfile
searching/indexing code and without loading the entire playerfile.

What are the other concerns/issues with using it as a server (or client for
that matter) side scripting language? What problems do stackless Python and
microthreading address?

-Todd McKimmey





_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev



More information about the MUD-Dev mailing list