[cctbxbb] Simple C++11 async example

Nicholas Devenish ndevenish at gmail.com
Fri Oct 2 03:26:10 PDT 2020


Hi All,

I seem to remember in most cases for us the python threading isn't too
much of an issue because the glue parts in python are relatively light
and we have the option of releasing the GIL for the heavy duty parts.

On Fri, Oct 2, 2020 at 9:58 AM Tristan Croll <tic20 at cam.ac.uk> wrote:
> On PyBind11, I have only good things to say about it. It's modelled off Boost.Python so the "feel" of it is very much the same, but being header-only it comes with no dependency baggage. For an example of a fairly big project wrapped with it, see https://github.com/tristanic/chimerax-clipper/tree/master/src/bindings. Whether it's desirable to go to the effort of converting the entire CCTBX? That's not for me to say.

> From: cctbxbb-bounces at phenix-online.org <cctbxbb-bounces at phenix-online.org> on behalf of David Waterman <dgwaterman at gmail.com>
> On that topic, I've heard many good things about pybind11. Does anyone have a feeling for how much work it would be to convert cctbx to pybind11 bindings rather than Boost.Python. Is this feasible? Is it desirable?

I really like pybind11 - it's active, has good documentation, and
deals with python 3 well. Boost.python is the exact opposite of this -
it's effectively dead, tries to pretend python3 doesn't exist, and the
documentation is awful - I actually read the pybind11 documentation
and then try to work out the differences to boost.python, the core is
similar enough. However, I've found almost no documented cases of
interoperation or of people porting large projects from one to the
other - I've tried to identify small subsets that could be
transitioned without doing everything at once, but sooner or later
most objects end up getting passed through to different parts of the
C++ code, so almost everything needs to be converted at once. An
automated conversion would probably work for 95% of the declaration
but then cause the remaining 5% to be more complicated. My frustration
with boost hasn't reached high enough levels that this has been worth
it yet, and we'd need complete agreement across cctbx and dials that
this needed to be done. That's a high bar.

Nick



More information about the cctbxbb mailing list