summaryrefslogtreecommitdiffstats
path: root/devel/pybind11/DETAILS
blob: e42a5b62480253734a8230411eaf4253ad2cdbc8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
source "${GRIMOIRE}/CMAKE_FUNCTIONS"
           SPELL=pybind11
         VERSION=2.4.1
          SOURCE="$SPELL-$VERSION.tar.gz"
   SOURCE_URL[0]=https://github.com/pybind/${SPELL}/archive/v${VERSION}.tar.gz
     SOURCE_HASH=sha512:4f1308f9db8d35ed2eea2a2bcb5f9fa08ccac0d86cdf686859f49d22c38da1dce2599531781bc8fef8f8b86f0eec82dd81870449022f29d508feb5a424e563fb
SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-${VERSION}"
        WEB_SITE="https://pybind11.readthedocs.io"
      LICENSE[0]=BSD
         ENTERED=20190920
           SHORT="a lightweight header-only library that exposes C++ types in Python and vice versa"
cat << EOF
pybind11 is a lightweight header-only library that exposes C++ types in Python
and vice versa, mainly to create Python bindings of existing C++ code. Its
goals and syntax are similar to the excellent Boost.Python library by David
Abrahams: to minimize boilerplate code in traditional extension modules by
inferring type information using compile-time introspection.

The main issue with Boost.Python—and the reason for creating such a
similar project—is Boost. Boost is an enormously large and complex
suite of utility libraries that works with almost every C++ compiler in
existence. This compatibility has its cost: arcane template tricks and
workarounds are necessary to support the oldest and buggiest of compiler
specimens. Now that C++11-compatible compilers are widely available, this
heavy machinery has become an excessively large and unnecessary dependency.

Think of this library 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. 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.
EOF