- What's New
cling goes public!
Submitted by axel on Tue, 30/08/2011 - 21:08
To a large extend thanks to Vassil's impressive commitment, cling now behaves like a good C++ interpreter: it runs C++ code that's entered, and prints the results.
[cling]$ #include <cmath> [cling]$ double x = std::sin(3.1) (double) 4.158066e-02 [cling]$ .L libz [cling]$ #include "zlib.h" [cling]$ zlibVersion() (const char * const) "22.214.171.124"
$ echo 'extern "C" const char* zlibVersion(); zlibVersion()' | cling -lz (const char * const) "126.96.36.199"
We have of course already added a few features that we liked from CINT - but cling is a completely new development, based on clang and llvm, a set of compiler libraries (to simplify the matter a bit :-) Vassil will present the innards of cling probably in October; I will post the slides here.
So what's special about cling? It's based on a production-grade compiler and it's designed taking decades of experience with CINT into account. And it doesn't need dictionaries! (Disclaimer: that does not mean that ROOT can do without, automatically. But that's our goal, of course.)
The next steps will be the ones most relevant for High Energy Physics: integration into ROOT (Paul is already working on that) and reloading of changed code (.x myCode.C, edit, .x myCode.C). That latter part is horrible for a compiler.
If you want to check cling out you can simply compile it yourself - it's really easy. I'd love to have an interactive, web-based interface once, but an online C++ interpreter is an invitation for script kiddies to hack the server :-( If you have an idea how to do it please let me know!