Efficient and Accurate Automatic Python Bindings with cppyy & Cling
Baidyanath Kundu (1, 2), Vassil Vassilev (1, 2), Wim Lavrijsen, (3) ((1) European Council for Nuclear Research, (2) Princeton University, (US), (3) LBNL (US))

TL;DR
This paper advances Python-C++ interoperability by enhancing cppyy with Cling and LLVM, enabling efficient, automatic, and lazy language bindings that improve performance and flexibility for scientific computing.
Contribution
It introduces a new approach to cppyy that leverages Cling and LLVM components for better performance, feature support, and sustainability in language bindings.
Findings
Enhanced cppyy enables on-demand C++ interrogation from Python.
Demonstrated integration of advanced C++ features with Python via cppyy.
Proposed re-engineering of cppyy using upstream LLVM components.
Abstract
The simplicity of Python and the power of C++ force stark choices on a scientific software stack. There have been multiple developments to mitigate language boundaries by implementing language bindings, but the impedance mismatch between the static nature of C++ and the dynamic one of Python hinders their implementation; examples include the use of user-defined Python types with templated C++ and advanced memory management. The development of the C++ interpreter Cling has changed the way we can think of language bindings as it provides an incremental compilation infrastructure available at runtime. That is, Python can interrogate C++ on demand, and bindings can be lazily constructed at runtime. This automatic binding provision requires no direct support from library authors and offers better performance than alternative solutions, such as PyBind11. ROOT pioneered this approach with…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsComputational Physics and Python Applications · Parallel Computing and Optimization Techniques · Software Engineering Research
