CERN Accelerating science

Talk
Title PyROOT: Seamless Melting of C++ and Python
Video
If you experience any problem watching the video, click the download button below
Download Embed
Mp4:Medium
(1000 kbps)
High
(4000 kbps)
More..
Copy-paste this code into your page:
Copy-paste this code into your page to include both slides and lecture:
Author(s) Mato Vila, Pere (speaker) (CERN)
Corporate author(s) CERN. Geneva
Imprint 2016-05-30. - Streaming video.
Series (Developers@CERN Forum)
(2nd Developers@CERN Forum)
Lecture note on 2016-05-30T16:00:00
Subject category Developers@CERN Forum
Abstract 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.
Copyright/License © 2016-2024 CERN
Submitted by jose.benito.gonzalez@cern.ch

 


 Record created 2016-06-02, last modified 2022-11-02


External links:
Download fulltextTalk details
Download fulltextEvent details