27 September 2004 to 1 October 2004
Interlaken, Switzerland
Europe/Zurich timezone

Reflection-Based Python-C++ Bindings

27 Sep 2004, 15:00
20m
Brunig (Interlaken, Switzerland)

Brunig

Interlaken, Switzerland

oral presentation Track 3 - Core Software Core Software

Speaker

W. LAVRIJSEN (LBNL)

Description

Python is a flexible, powerful, high-level language with excellent interactive and introspective capabilities and a very clean syntax. As such it can be a very effective tool for driving physics analysis. Python is designed to be extensible in low-level C-like languages, and its use as a scientific steering language has become quite widespread. To this end, existing and custom-written C or C++ libraries are bound to the Python environment as so-called extension modules. A number of tools for easing the process of creating such bindings exist, such as SWIG or Boost.Python. Yet, the the process still requires a considerable amount of effort and expertise. The C++ language has little built-in introspective capabilities, but tools such as LCGDict and CINT add this by providing so-called dictionaries: libraries that contain information about the names, entry points, argument types, etc. of other libraries. The reflection information from these dictionaries can be used for the creation of bindings and so the process can be fully automated, as dictionaries are already provided for many end-user libraries for other purposes, such as object persistency. PyLCGDict is a Python extension module that uses LCG dictionaries, as PyROOT uses CINT reflection information, to allow Python users to access C++ libraries with essentially no preparation on the users' behalf. In addition, and in a similar way, PyROOT gives ROOT users access to Python libraries.

Primary authors

Presentation Materials