30-31 May 2016
CERN
Europe/Zurich timezone
There is a live webcast for this event.

PyROOT: Seamless Melting of C++ and Python

30 May 2016, 16:00
30m
31/3-004 - IT Amphitheatre (CERN)

31/3-004 - IT Amphitheatre

CERN

105
Show room on map

Speaker

Pere Mato Vila (CERN)

Description

With ROOT it's possible to use any C++ library from Python without writing any bindings nor dictionaries: loading the library and injecting the relevant headers in the ROOT C++ interpreter is enough to guarantee interactive usage from within Python. Just in time (JIT) compilation of C++ code and immediate utilisation of C++ entities from within Python is also supported.

Thanks to the ROOT type system and C++ interpreter and JIT compiler, complete Python/C++ interoperability is achieved. In this contribution we explain how this mechanism is general enough to make any library written in C or C++ usable from within Python and how concepts such as template metaprogramming are mapped in Python. We review the basics of the JIT compilation capabilities provided by the Clang based ROOT interpreter, Cling, and the way in which some of the information of the Abstract Syntax Tree (AST) built by Clang is stored by the ROOT type system. The way in which ROOT manages the automatic loading of libraries and parsing of necessary headers is also described.
We illustrate from the programming model point of view the simplicity of the invocation of the C++ entities from within the Python world through concrete examples.

Live demos are provided whenever possible to grant the audience an enhanced experience.

Talk Length 30 minutes

Presentation Materials