Speaker
Description
High Energy Physics (HEP) software environments make extensive use of blended C++ and Python workflows, combining performance and simple interfaces. In this context, a C++ compiler stack comprising technologies such as Clang, Cling, and cppyy provides generic dynamic Python-C++ bindings and powers many of the Python interfaces used in the field, including those of the ROOT software framework.
Several techniques exist to bridge C++ and Python in mixed-language applications including just-in-time compilation of Python functions to native code, such as Numba-based approaches, as well as dynamic bindings relying on automatic type conversion mechanisms provided by cppyy. Both approaches are effective in many use cases, but constrained by the need to operate on a restricted subset of Python.
In this contribution, we introduce an experimental execution model that leverages cppyy’s dynamic converters to invoke pure Python code directly from within the C++ runtime. This approach enables the execution of Python constructs and libraries that were previously incompatible with existing integration techniques.
We explore how far this alternative model can be pushed: what types of Python functions, objects, and external packages can be used inside a C++ execution environment? What are the performance and usability implications? We then evaluate the limitations and potential of this model using the generic high level interface provided by ROOT, RDataFrame, as a notable example of the wide range of applications enabled by this approach.