# PyROOT: Seamless Melting of C++ and Python

- Institution: CERN
- Department: Developers@CERN Forum
- Speaker: Pere Mato Vila
- Year: 2016
- Language: English
- Source: [CERN](https://videos.cern.ch/record/3007244)
- Licence: [CERN](http://copyright.web.cern.ch)
- Who can watch: Teens profiles and older (sources give no ratings; placed by Invisible Network from the source's own words)

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..

0:00:00 Slide 1

0:00:16 Slide 2

0:00:46 Slide 3

0:02:00 Slide 4

0:04:19 Slide 5

0:05:06 Slide 6

0:07:14 Slide 7

0:08:36 Slide 8

0:09:25 Slide 9

0:09:42 Slide 10

0:10:22 Slide 11

0:11:03 Slide 12

0:12:45 Slide 13

0:13:50 Slide 14

0:14:41 Slide 15

0:15:54 Slide 16

0:16:41 Slide 17

0:17:29 Slide 18

0:19:25 Slide 19

0:20:20 Slide 20

0:20:56 Slide 21

0:22:35 Slide 22

0:23:40 Slide 23

0:24:14 Slide 24

0:25:52 Slide 25

## Lectures

1. [PyROOT: Seamless Melting of C++ and Python](https://invisiblenetwork.ai/learn/cern/3007244/b0a9de3d257f), 34 min (CERN's player)
