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 is however not trivial and might suffice for simple optimization of performant 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 performances since it is much easier to binding complex libraries like Rat than with Boost.Python or Cython even though it introduces many 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.