Related work
Pyrex [Pyrex] is the compiler project that Cython was originallybased on. Many features and the major design decisions of the Cythonlanguage were developed by Greg Ewing as part of that project. Today,Cython supersedes the capabilities of Pyrex by providing asubstantially higher compatibility with Python code and Pythonsemantics, as well as superior optimisations and better integrationwith scientific Python extensions like NumPy.
ctypes [ctypes] is a foreign function interface (FFI) for Python. Itprovides C compatible data types, and allows calling functions in DLLsor shared libraries. It can be used to wrap these libraries in purePython code. Compared to Cython, it has the major advantage of beingin the standard library and being usable directly from Python code,without any additional dependencies. The major drawback is itsperformance, which suffers from the Python call overhead as alloperations must pass through Python code first. Cython, being acompiled language, can avoid much of this overhead by moving morefunctionality and long-running loops into fast C code.
SWIG [SWIG] is a wrapper code generator. It makes it very easy toparse large API definitions in C/C++ header files, and to generatestraight forward wrapper code for a large set of programminglanguages. As opposed to Cython, however, it is not a programminglanguage itself. Thin wrappers are easy to generate, but the morefunctionality a wrapper needs to provide, the harder it gets toimplement it with SWIG. Cython, on the other hand, makes it very easyto write very elaborate wrapper code specifically for the Pythonlanguage, and to make it as thin or thick as needed at any givenplace. Also, there exists third party code for parsing C header filesand using it to generate Cython definitions and module skeletons.
ShedSkin [ShedSkin] is an experimental Python-to-C++ compiler. Ituses a very powerful whole-module type inference engine to generate aC++ program from (restricted) Python source code. The main drawbackis that it has no support for calling the Python/C API for operationsit does not support natively, and supports very few of the standardPython modules.
[ctypes] | https://docs.python.org/library/ctypes.html. |
[ShedSkin] | M. Dufour, J. Coughlan, ShedSkin,https://github.com/shedskin/shedskin |
[SWIG] | David M. Beazley et al.,SWIG: An Easy to Use Tool for Integrating Scripting Languages with C and C++,http://www.swig.org. |