[capi-sig] Problem with reference

Stefan Behnel python_capi at behnel.de
Tue Mar 3 16:22:33 CET 2009


Gustavo Carneiro wrote:
> 2009/3/3 Stefan Behnel wrote:
>> Cython is (literally) not a wrapper generator as it will not generate a
>> wrapper for you. You have to write it yourself. Cython is a programming
>> language to write extension modules for CPython, as generic as that.
>
> OK, but surely we can say that Cython is a code generator, or compiler.
> [...]
> It is more or less at the same level as Boost.Python.
> You also have to write the wrapper code using Boost.Python yourself...

Except that Boost.Python does not optimise the code for you, simply
because it is a library, not a compiler. It doesn't know what called it
with what intention. The Cython compiler can extract a lot of information
from your code and it *will* use it to make your code run fast. For
example, calling a Cython implemented function is very fast compared to
normal Python, simply because we can adapt the generated code to the
specific signature of a function, instead of relying on generic argument
unpacking code.

Stefan



More information about the capi-sig mailing list