News for hackers. Stuff that matters.
Re:Cling: An Interactive C++ interpreter by radarsat1 on Sunday May 22, 2016 @10:29AM (#11748693)
I want to see something like this available from gdb. Following code that uses shared_ptr in gdb is still awful. It would be great to be able to explore the stack frame properly, looking at STL containers without hassle and calling functions and everything.
Re:Cling: An Interactive C++ interpreter by stevedonovan on Sunday May 22, 2016 @11:45AM (#11748985)
Modern gdb does have Python plug-ins, and e.g. I'll get "std::vector of length 3, capacity 4 = {10, 20, 30}" when printing a vector, and "std::shared_ptr (count 1, weak 0) 0x8059e10" when printing a shared ptr. But oh yes, it could be so much better. For instance, often you cannot call methods on template stuff (that is, everything) because 'it may be inlined'
Re:Cling: An Interactive C++ interpreter by microcolonel on Sunday May 22, 2016 @12:48PM (#11749260)
"May" ought to be translated as "must". Templated C++ is incredibly sluggish without inlining. People are comfortable debugging C programs with more advanced optimizations turned off because performance will still be decent. In C++, the optimizations are the only reason it ever performs reasonably.
Re:Cling: An Interactive C++ interpreter by ccurtsinger on Sunday May 22, 2016 @01:10PM (#11749349)
Not really. Calling a C++ template-generated function is no different than calling a C function. If you have a lot of tiny template-generated functions then sure, it would be slow. But no slower than a C program with a bunch of tiny functions.
Re:Cling: An Interactive C++ interpreter by doomrobo on Sunday May 22, 2016 @04:01PM (#11750025)
Maybe they are thinking of specializing for static dispatch?