A Read-Eval-Print-Loop enables to leverage very rapid application development. This kind of environment is normaly reserved to scripting languages (python, nodejs) and to functional languages (lisp, haskell).
Cling realizes the read-eval-print loop (REPL) concept for the C++ language. Thus, you can gain in speed of development while the compiler (clang) still checks your code and guarantees a native speed of execution.
C++ REPL in a console | C++ REPL inside jupyter notebook |
You can run a full C++ REPL from your console. In order to test this, the easiest way is to install the provided docker container. Refer to the docker instructions
See an example of an interactive C++ session here.
if you are reading this inside jupyter notebook
If you are viewing a slideshow
Load, display and manipulate images with opencv. Demonstrates how to load an external library and display advanced items.
View this document:
A Read-Eval-Print-Loop makes functional programing very proficient. This notebook demonstrates it. If you are new to functional programming, it is recommended to view it as a slideshow.
View this document:
The cling and xeus docs are good, but some informations are missing : this notebook adds more details.
View this document:
If you do not want to modify your machine, you can use the docker image provided inside this repo.
Refer to the docker instructions.
Refer to the instructions on the xeus cling web page
As mentioned before, these demos are available online on mybinder.org.
Cling is an interactive C++ interpreter, built on top of Clang and LLVM compiler infrastructure. Cling realizes the read-eval-print loop (REPL) concept, in order to leverage rapid application development. Implemented as a small extension to LLVM and Clang, the interpreter reuses their strengths such as the praised concise and expressive compiler diagnostics.
It is based on the Root data analysis framework, and originates from the CERN. Cling is stil under heavy development and might fail (for example a segfault in your program will exit cling REPL). However it is quite useful, and used everyday at the CERN.
Xeus cling is a Jupyter kernel for the C++ programming language based on cling.
Read the docs here.
If you do not know jupyter notebook, take some time to familiarize yourself with the concept here: