jump to navigation

C++ Not Dead? April 6, 2007

Posted by gordonwatts in computers.
trackback

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.

Comments»

1. Craig Penner - April 23, 2007

Sounds good.

2. 8-core Machines « Life as a Physicist - June 12, 2007

[…] the C++ language is not much help. The new C++ standard is going to add some multi-threading capabilities, but that won’t help us modify our code. There are some cool pragma’s — so called […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: