# Interactive C++ for Data Science

DevFeed: [Interactive C++ for Data Science](<https://devfeed.tech/articles/interactive-c-for-data-science-43072.md>)

Original publisher: [Read original article](<https://blog.llvm.org/posts/2020-12-21-interactive-cpp-for-data-science/>)

Author: Vassil Vassilev, David Lange, Simeon Ehrig, Sylvain Corlay

Published: 2020-12-20T10:00:00Z

Content type: article

Language: en

Sources: [LLVM Project](<https://devfeed.tech/sources/the-llvm-project-blog.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Data Science](<https://devfeed.tech/topics/data-science.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Software](<https://devfeed.tech/topics/software.md>), [CUDA](<https://devfeed.tech/topics/cuda.md>), [Computing](<https://devfeed.tech/topics/computing.md>)

Tags: [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [cling](<https://devfeed.tech/tags/cling.md>), [code](<https://devfeed.tech/tags/code.md>), [computing](<https://devfeed.tech/tags/computing.md>), [cuda](<https://devfeed.tech/tags/cuda.md>), [data-science](<https://devfeed.tech/tags/data-science.md>), [data-serialization](<https://devfeed.tech/tags/data-serialization.md>), [interpreter](<https://devfeed.tech/tags/interpreter.md>), [programming](<https://devfeed.tech/tags/programming.md>), [runtime](<https://devfeed.tech/tags/runtime.md>)

## AI overview

This article describes how Cling enables interactive C++ for data science, including eval-style programming, runtime evaluation, and interactive access to complex libraries and data. It also explains how ROOT uses Cling for scientific data analysis, serialization, and visualization in high-energy physics.

## Source excerpt

Interactive C++ for Data Science In our previous blog post "Interactive C++ with Cling"we mentioned that exploratory programming is an effective way to reduce thecomplexity of the problem. This post will discuss some applications of Clingdeveloped to support data science researchers. In particular, interactivelyprobing data and interfaces makes complex libraries and complex data moreaccessible to users. We aim to demonstrate some of Cling's features at scale;Cling's eval-style programming support; projects related to Cling; and showinteractive C++/CUDA. Eval-style programming A Cling instance can access itself through its runtime. The example creates acling::Value to store the execution result of the incremented variable i.That mechanism can be used further to support dynamic scopes extending the namelookup at runtime. [cling]$ #include <cling/Interpreter/Value.h>[cling]$ #include <cling/Interpreter/Interpreter.h>[cling]$ int i = 1;[cling]$ cling::Value V;[cling]$ gCling->evaluate("++i", V);[cling]$ i(int) 2[cling]$ V(cling::Value &) boxes [(int) 2] V "boxes" the expression result providing extended lifetime if necessary.The cling::Value can be used to communicate expression values from theinterpreter to compiled code. [cling]$ ++i(int) 3[cling]$ V(cling::Value &) boxes [(int) 2] This mechanism introduces a delayed until runtime evaluation which enables somefeatures increasing the dynamic look and feel of the C++ language. The ROOT data analysis package The main tool for storage, research and visualization of scientific data in thefield of high energy physics (HEP) is the specialized software package ROOT.ROOT is a set of interconnected components that assist scientists from datastorage and research to their visualization when published in a scientificpaper. ROOT has played a significant role in scientific discoveries such asgravitational waves, the great cavity in the Pyramid of Cheops, the discovery ofthe Higgs boson by the Large Hadron Collider. For the last 5 ye