About bindings¶
CPython is the base implementation of Python, and bindings between the two languages have been a common theme across many other works such as the NumPy module.
Using performant compiled C code from a flexible Python script has always seemed appealing to many developers. The base way of doing so is however not trivial: it might suffice to optimize the performance-critical parts of a module, but larger codebases are something different entirely.
Many frameworks appeared in order to streamline the process of interfacing C, then also C++ code, to Python such as Boost.Python, Cython and pybind11.
The pybind11 framework is an interesting middle-ground between simplicity and performance since it is much easier to bind complex libraries like Rat than with Boost.Python or Cython, even though it introduces some overhead.
It remains however a decent standard to quickly get started with something somewhat functional.
Note
nanobind might also be given a look in the future since it promises better performance and smaller build times than its pybind11 counterpart.
PYRAT ABOUT BINDINGS CONTENTS