C++ Not Dead? April 6, 2007Posted by gordonwatts in computers.
I’ve made lots of comments on this blog that I think C++ is stagnating and all the interesting features to help programmers with their jobs are being added to languages like C#, java, python, ruby, etc. But C++ is approaching its next draft of the standard. (ISO C++0x, where x is “7” or “8”). I read Herb Sutter’s blog, and he is on the ISO committee and he has a blog posting on what might be be included in the next version of C++.
Some of the things are fixes. For example, the horrid error messages one gets when a compilation error occurs during template instantiation. Another, mutli-threading libraries, addresses a basic portability problem. But neither of these really pushes the language into new ground. Both will help the programmer, of course!
The other thing that Herb talks about, however, is interesting: garbage collection. No worries! It sounds like an opt-in scheme. In DZERO we have had a lot of trouble with memory leaks. Heck, just look at ROOT (sorry, couldn’t resist). Even here, of course, C++ is playing catch up. But this is a welcome addition. As they point out in the transparencies linked to above, there are many reasons why you might want to have explicit memory management (low level system programming, memory hungry programs, performance critical programs). But most HEP algorithms for reconstruction do not fit this bill! I look forward to seeing if we can take advantage of this.
As a side note, I’m not sure ROOT will be able to benefit from this. This is because is makes use of void* pointers and also redefines the new operator. They say in several places in the transparencies that garbage collection as they want to specify it will not work under this circumstances. Oh well.