BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

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

| by Sergio De Simone Follow 4 Followers on May 23, 2015. Estimated reading time: 1 minute |

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

Tell us what you think

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

Email me replies to any of my messages in this thread
Community comments

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

Email me replies to any of my messages in this thread

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

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT