[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Google Summer of Code participation



Marcus von Appen wrote:
On, Fri Mar 13, 2009, Toni Alatalo wrote:

Marcus von Appen kirjoitti:
On, Thu Mar 12, 2009, Iuri wrote:
In the wiki we have 2DVectorClass and 3DVectorClass classes. Why these
They are good, but in Python, making them slower than a good and robust
C implementation.
I wonder if porting them from Python to Cython (the new pyrex) to get the good and robust C implementation would be a good solution.

I do not know anything about Cython, but if the code it generates is
actually maintainable (means: well-structured, readable and easy to
modify), it might be worth a try.

That totally defeats the purpose of Cython. One maintains the Cython code. The C code is just an intermediary step in compiling an extension module. The intermediate C is easier to follow than that generated by other high level languages, but one would not want to alter it. Have a look at pypm.c for an example generated with Pyrex.

But I do have my concerns. Cython is not a stable language. It may change to remain compatible with Pyrex, which is still in alpha development. This just means keeping ones Cython compiler current. Also Cython doen't support variable length types, tp_itemsize not zero. This might be of concern if vector size is an attribute.

Lenard

--
Lenard Lindstrom
<len-l@xxxxxxxxx>