Search NASA⌕ Search

DOE OSTI · code-34247

Bindee

Abstract

Bindee is a clang tool that outputs a simple pybind11 template given a C++ file for efficient generation of C++-Python bindings. Bindee is intended to be a helper tool for minimizing initial user effort and safeguarding against common runtime errors. Bindee relies on two open-source software to produce bindings. Clang's LibTooling enables bindee to traverse a C++ file's AST to pick out bindable variables and functions, or "bindees." PyBind11 is templated, header-only library for generating C++-Python bindings for variables and functions. Operating purely in C++, bindee does not require learning any new API for accomplishing its task. Additionally, picking the correct pybind11 API for a given bindable element is handled without interaction from the user. Any user input is denoted by '@TEXT@' string substitution. Bindee is capable of generating modular bindings for public class methods, public class variables, enumerations, and free functions and variables. Bindings for templates are also supported. For those familiar with pybind11, bindee does not handle trampolines, C++ extensions through lambdas, or custom type casters.

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Kimkno, JasonS.. 2020-01-24. Bindee. https://doi.org/10.11578/dc.20200207.2

Cite the original work for its findings. Save a collection to share your selection of sources.