Pyrex praise (repeat)

Terry Hancock hancock at
Tue Aug 13 03:11:42 CEST 2002

Hi Lalo!

> Terry Hancock <hancock at> wrote in message
> news:<mailman.1028666233.8927.python-list at>...
> > 
> > I'm wondering if Pyrex is for me --
> As someone who knows personally the project you're talking about, I'd
> recommend you at least give it a try.

To counter the conspiracy theorists ;-), this a proposed
extension to:

and related to:

that we're talking about.

Neither is really active right now (except that Lalo did
a great job on bringing PUB (=py-universe) into the
21st century recently, thanks!).

However, I'm thinking about getting back into it. Part
of the motivation to use Pyrex, of course, would be
just to use it.  Pyrex looks like a real good fit for
the SDL-wrapper in AutoManga, too (I'm aware of PySDL,
but the main thing about the AutoManga wrapper is not
just its use of SDL, but the cel-animation metaphor in
the proposed API).

As someone pointed out earlier, the design is "not well
thought out". That's certainly fair. What I'm trying to
do is get it working fast enough to experiment with it,
and my early attempts suggested that this would be hard
with pure Python. The reason is probably that the data
representation is a poor fit to the built-in types, and
one is therefore defining a new numeric type. If one then
needs to build and iterate over collections of such numbers
and do some math on them, the result can get really slow.

> However, as someone else said, instead of just pyrexizing the fusion,
> I'd turn the whole emotion structure into a pyrex extension class, and
> store the data in a C structure.

Yeah. That's my impression too, now. I think I wasn't
necessarily giving the look-up time much consideration --
I was blaming it on the floating point operations. Making
both an emotion (numerical) class and a emotional-set
class (probably a C array internally, with all the Python
sequence methods defined), seems like a plan to me. I
still need to get Python 2.2 and Pyrex and convert my
sources over (just snippets right now).

The sticky part is probably deciding which affects get
considered. In some idealized model, we should consider
the characters feelings towards every object in the game,
but that's probably wasteful -- surely the character has
weak affect for cups and saucers.  So we're probably
talking about slicing off the 100 or so top-intensity
items, providing explicit lists in the character
definition files, or using an intensity cutoff of some
kind. There's also the issue of whether seemingly
unimportant things can take on special meaning (e.g.
character A gives character B a ring, the ring becomes
important to character B).  All of which is pretty vague
yet.  But I'll work on it.


Terry Hancock
hancock at       
Anansi Spaceworks         
P.O. Box 60583                     
Pasadena, CA 91116-6583

More information about the Python-list mailing list