BT

InfoQ Homepage News Cling Aims to Provide a High-performance C++ REPL

Cling Aims to Provide a High-performance C++ REPL

Bookmarks

Cling is an interactive C++ interpreter that is built on top of LLVM and Clang and promises to provide a leap in productivity by going beyond the usual code-compile-run-debug C++ workflow.

Cling provides a read-eval-print loop (REPL) that is similar to common Unix shells and supports Emacs bindings. By using Cling, it is possible to test a C++ snippet bypassing the need to create a file, include headers, etc. The main advantage of using a REPL comes from the possibility of testing an idea in a fraction of second, without having to wait for the build system to compile the code. A REPL is also very useful when learning a language since it makes it easier to try out language features.

Cling is developed by the group behind Cern's ROOT data analysis framework as an alternative to their existing CINT command line C/C++ interpreter. ROOT is famously behind many current experiments in particle physics, including the Large Hadron Collider.

Cling can parse everything that Clang can do, while also supporting a few CINT-specific C++ extensions. Among the main advantages provided by Cling, the ROOT dev team lists the use of a production-grade parser, JIT allowing to call into libraries without wrappers, and the use of separate parser and execution engine.

Cling is available on GitHub and can be either installed from nightly binaries or built from source. The official all-in-one build script supports Unix-based systems while manual build is possible on Windows through CMake. Gallagher Pryor additionally describes a procedure to build Cling for the ARM platform, which is significantly more convoluted than building for x86, since the development team does not directly support this option through their build scripts.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.