[HTCondor-devel] HTCondor Python Bindings: propose to implement via pybind11 instead of Boost?


Date: Tue, 24 Apr 2018 14:46:45 -0500
From: Todd Tannenbaum <tannenba@xxxxxxxxxxx>
Subject: [HTCondor-devel] HTCondor Python Bindings: propose to implement via pybind11 instead of Boost?
Hi all,

Currently our increasingly popular HTCondor python bindings are implemented via Boost.Python. Now that all HTCondor supported platforms have C++11-compatible compilers, I propose we consider implementing our bindings via pybind11 [see below for description] instead. Boost.Python is about the only significant thing we use Boost for these days.... moving to pybind11 would allow us to eject Boost. We need to do some investigative work, but I think most of our existing Boost.Python binding code could be moved over with mostly superficial syntactical changes. Of course we should maintain API compatibility.

pybind11 was written as more or less a replacement for Boost.Python, so I think it should do well for the bindings, but I am not sure if the embedded Python interpreter for ClassAd function extensions uses Boost or not.

Thoughts? Comments?

regards,
Todd

What is pybind11 ?

From https://github.com/pybind/pybind11 :

Think of pybind11 as a tiny self-contained version of Boost.Python with everything stripped away that isn't relevant for binding generation. Without comments, the core header files only require ~4K lines of code and depend on Python (2.7 or 3.x, or PyPy2.7 >= 5.7) and the C++ standard library.

And pybind11 actually has decent, complete, organized documentation. It looks to have pretty active, wide, and growing support (although I would want to confirm that at least a few other major projects are using it today).

Everything for pybind11 is contained in just a few header files; there is no need to link against any additional libraries!

This compact implementation was possible thanks to some of the new C++11 language features (specifically: tuples, lambda functions and variadic templates). Since its creation, this library has grown beyond Boost.Python in many ways, leading to dramatically simpler binding code in many common situations.


--
Todd Tannenbaum <tannenba@xxxxxxxxxxx> University of Wisconsin-Madison
Center for High Throughput Computing   Department of Computer Sciences
HTCondor Technical Lead                1210 W. Dayton St. Rm #4257
Phone: (608) 263-7132                  Madison, WI 53706-1685
[← Prev in Thread] Current Thread [Next in Thread→]