[Python-Dev] Let's change to C API!

Jeroen Demeyer J.Demeyer at UGent.be
Tue Jul 31 10:01:11 EDT 2018


On 2018-07-31 15:34, Victor Stinner wrote:
> But I never used Cython nor cffi, so I'm not sure which one is the
> most appropriate depending on the use case.

Cython is a build-time tool, while cffi is a run-time tool.

But Cython does a lot more than just FFI. It is a Python->C compiler 
which can be used for FFI but also for many other things.

> A major "rewrite" of such large code base is
> very difficult since people want to push new things in parallel. Or is
> it maybe possible to do it incrementally?

Yes, that's not a problem: you can easily mix pure Python code, Cython 
code and C code.

I think that this kind of mixing is an important part in Cython's 
philosophy: for stuff where you don't care about performance: use 
Python. For most stuff where you do care: use Cython. For very 
specialized code which cannot easily be translated to Cython: use C.


Jeroen.


More information about the Python-Dev mailing list