I think the biggest difference is that boost.python is a way to write
wrappers using C++ syntax, Cython is a way to write wrappers using
Python syntax, which influences both syntax and the perspective taken
and volume of extra details to handle when doing the wrapping. Part of
this is a matter of personal preference, but there are a couple of
other objective differences.
* Cython generates faster code than boost.python, at least in all the
latest benchmarks I've seen.
* Cython is generally faster to compile, especially if you're just
wrapping a couple of plain C functions, probably in large part to
boost's heavy use of templates.
* Cython allow you to improve your code incrementally, if something
isn't fast enough just move it to a .pyx file and measure again.
Profile to see where your bottleneck is and add a type here or there.
The boundary between low and high level code is much more flexible
(both in mechanics and in style).
* Cython is designed for writing more than just wrappers. This IMHO
makes it easy to write Pythonic bindings that are more than simply 1:1
exposures of the underlying C++ API. When doing so you can use
arbitrary Python language features.
Though the first two could be addressed by improving boost.python,
eventually, but we're a moving target too. It'd be harder to do
anything about the latter two which I think is the bigger win.
On the other hand
* Boost.python probably has better support for stl containers. For
Cython, there is a fixed number of automatic conversions that we
support (e.g. integer types, correctly handing overflow and
signedness) and handle stl containers that are (recursively) composed
of these.
* Boost.python seems to have better support for exposing C++ classes
as Python classes. With Cython you actually create a Python class that
explicitly wraps a C++ instance. This is both a pro and con (see the
last two advantages points above).
- Robert