Stroustrup's talk on C++0x

Walter Bright newshound1 at digitalmars.com
Wed Aug 22 22:53:23 PDT 2007


Bill Baxter wrote:
> Walter Bright wrote:
>> I think it's the success of D that lit the fire.
> 
> It probably gave them a nudge,

More than that. The active people on the C++ committee are well aware of 
D. Many have attended my presentations on D, correspond with me about 
it, and lurk in this n.g. Most of them will deny the influence, however, 
so feel free to decide what to believe <g>.


> but on the other hand, as is abundantly 
> clear here on this newsgroup, everybody has a favorite feature.  So if 
> you throw a bunch of engineers and language designers into a room, the 
> natural tendency is towards trying to add everything and the kitchen 
> sink.

One thing the C++ committee is good about is the features they have 
added *are* targeted at glaring shortcomings. They really are not 
throwing in the kitchen sink. How well those shortcomings are addressed, 
however, is another matter. For example, look at the C++ proposal for 
doing a very limited form of compile time function evaluation, then 
compare it with D's.


> But I agree that the fact that D is out there (and probably C#, 
> Python, and Ruby, too) undoubtedly influenced people's votes when it 
> came time to decide whether it was more important to have feature X or 
> get the revision out sooner.

GC is a prime example of that; C++ could no longer dismiss it. (And Hans 
Boehm, who I admire a lot, did a spectacular job of dealing with every 
objection to adding GC.)


> It is pretty scary, though, to hear Stroustrup saying that the C++ text 
> books will need to become thicker than they already are, which was 
> already about 3x as big as K&R's original book on C.

There are two phases to learning C++:

1) learning the language
2) learning all the idioms and conventions used to avoid the shortcomings

(One example we've discussed here recently is the slicing problem.)


> The one feature (or lack thereof) that surprises me about C++0x is 
> nested functions.  They're one of my favorite things about D, but they 
> don't seem to be a part of C++0x.  There can't be any fundamental reason 
> for it, since I've heard g++ supports them.  Maybe lambdas will serve 
> that purpose?

I was surprised to see lambdas without nested functions.


> As for standards vs standards-compliant compilers, note that MS still 
> hasn't made a C99 compiler, 8 years after the standard.  And 
> implementing *that* standard looks like an undergrad homework assignment 
> compared to what compiler writers will have to go through for C++0x.

It took 5 years for a C++98 compliant compiler to emerge. Extrapolating 
to C++09, that would be 2014 to get features that existed in D years 
ago. I obviously gave up waiting for such features from C++ long ago.



More information about the Digitalmars-d mailing list