[vworld-tech] Python

Mike Shaver mike.shaver at gmail.com
Tue Apr 26 21:36:10 PDT 2005

On 4/26/05, Brian Hook <hook_l at bookofhook.com> wrote:
> I know Eve Online used Stackless Python, but I don't even know what
> the hell that is, so I guess I should look into it =)

Stackless will help you overcome what is IMO the biggest limitation of
Python for game server work: the loathsome global interpreter lock. 
By making "microthreads" possible through the removal of C-stack use
for interpreter state, you can write much more naturally-parallel
code, with constructs like 'waitFor' and 'sleep' -- common
requirements for

> > My personal server-side scripting preference, lately, is
> > Spidermonkey (the JavaScript implementation provided by
> > mozilla.org), and I believe there was some discussion about it on
> > this list last year.
> Is this for _scripting_ or for server development?  I'm leaning away
> from "Scripting" and looking at using a language more for first order
> development as opposed to leaf scripts (e.g. monster "think"
> routines).

(Disclosure: I've worked on the Spidermonkey JS engine for more than 7
years, so I might be considered to be a little biased.  I sometimes
prefer the term "informed". =) )

The Spidermonkey engine has been used as the core of a large number of
apps, some as leaf scripting, some as a primary application language
(as with the Firefox browser, whose app logic is almost entirely
JavaScript, and JSP-like server-side apps) to good effect.  The
performance is quite good, and a lot of work has been done to give
good threading performance, including deferring virtually all object
locking cost until the object is actually used by more than one
thread.  One thing that might cause you pain is the nature of the
garbage collector, which requires that all threads synchronize for
collection to proceed.  You can tune that relatively well, but it's
not without some pain.

You might also want to look at a system like Mono or Microsoft's .NET,
which will let you mix script (including Python) with a more 'systems'
language like C#, and let the pieces play together quite nicely.


More information about the vworld-tech mailing list