Cling’s Context, Status and Plans Prototype of ROOT’s new Interpreter and Reflection Database Axel Naumann, 2011-03-14
Timetable 9:05 Motivation for cling 9:10 Context for a new interpreter 9:20 Status 9:25 Plans 2
Motivation 3
Motivation Deficiencies of CINT now relevant: Correctness C++ support, also C++ 1x Speed Maintenance 4
Why cling cling based on open source compiler llvm / clang Correctness C++ support, also c++ 1x Speed Maintenance 5
Why cling cling based on open source compiler llvm / clang Correctness C++ support, also c++ 1x Speed Maintenance 5
Why cling cling based on open source compiler llvm / clang Correctness C++ support, also c++ 1x Speed Maintenance 5
Why cling cling based on open source compiler llvm / clang Correctness C++ support, also c++ 1x Speed Maintenance 5
Why cling cling based on open source compiler llvm / clang Correctness C++ support, also c++ 1x Speed Maintenance 5
Context 6
Context BACKWARD COMPATIBILITY! CINT features, C++ extensions ROOT Reflection & I/O: TCint, TClass Dictionaries: selection.xml, Linkdef.h Reflex 7
CINT features, ++C++ Dynamic scope: new ¡TFile(“h.root”); hist-‑>Draw(); .x mycode.C Un- / Reloading: //edit .x mycode.C #includes, library loading, variable declaration: all implicit 8
ROOT Reflection Interface to CINT is TCint; re-implement using cling/clang/llvm Proper overload resolution (signal/ slot etc) Will allow full access to C++ through ROOT (enum, ...) Simplifies dictionaries (shadow,...) 9
ROOT Reflection (2) Reflection database: clang abstract syntax tree (AST) authoritative covers full language built-in persistence: precompiled headers (PCH) 10
PCH / Dictionary Depend on platform not compiler! No wrappers needed if LLVM-JIT available (e.g. all LCG platforms) Less disk size, less RAM: partial loads on demand FAST lookup: used by clang itself
ROOT I/O type names change // CINT: // clang: vector<string> std::vector<std::string> A::B<C> A::B<A::C> ROOT with CINT ROOT with Cling using namespace std Old TFile A::B<C> new lookup 1) change type names OR Future TFile 2) Backport to old ROOT 12
Type Names and ROOT Very different from CINT7! CINT7 cling Functionally Type Names CINT-compatible equivalent Reflection DB Reflex clang Type Lookup CINT, Reflex clang Dict Format CINT, Reflex clang* Handling A<B=alloc> CINT vs Reflex clang vs A 13
Dictionaries selection.xml, Linkdef.h will map to same selection algorithm (already implemented) Selection on clang AST (to be done) Backward compatible invocation and output (happy Makefiles) 14
Reflex Becomes 2nd-tier reflection interface Reflex exposes underlying collection types through typedefs. Two options: Copy clang AST to Reflex Change underlying iterator types Up to the experiments to decide 15
Status 16
Status Interpreter: ROOT with execution in cling, reflection in CINT Some CINT extensions implemented .x hsimple.C just works! No changes in clang + llvm needed! 17
Status (2) Reflection: Linkdef / selection.xml parser 70%: Reflex dict from clang AST 50%: dictionary in PCH, to do: >1 PCHs, AST node selection 10%: TCint ➠ TCling 18
Plans 19
Plans PCH dictionary Independent: validate type name chain header ➠ rootcling dict ➠ Reflex ➠ Cintex ➠ CINT (Reflex because of similarity GCC / clang type names) Verify compatibility of type names in reco file 20
Plans (2) Offer interpreter to clang by summer: visibility, show good manners Embed in ROOT, --enable-cling Implement missing + functionally required (cf. backward compatibility) CINT features Study cling + multi-threading 21
Outlook 22
Outlook Long list of crazy items: who would’ve thought a compiler can...! Working down the list until we’re done Now that basics are there: regular cling progress report @ ROOT.cern.ch (search for cling) 23
Recommend
More recommend