.. _cffi:
++++
cffi
++++
An alternative to the C API is to rewrite a C extension using `cffi
`__.
XXX write a better rationale why migrating to cffi!
Questions:
* Is it easy to distribute binaries generated by cffi to avoid to require C
headers and a C compiler? (Windows, macOS, Linux?)
* How many popular Python modules use the C API? See :ref:`Consumers of the
Python C API `.
* How long would it take to rewrite a C extension with ``cffi``?
* What is the long-term transition plan to reach the "no C API" goal? At least,
CPython will continue to use its own C API internally.
* How to deal with :ref:`backward compatibility `?
Small practical issue: ``cffi`` is not part of the Python 3.7 standard library
yet. Previous attempt to add it, in 2013: `[Python-Dev] cffi in stdlib
`_.
See also :ref:`Cython ` and :ref:`Remove the C API `.