[petsc-dev] C++11, compatibility versus simplicity

Tim Tautges tautges at mcs.anl.gov
Thu Oct 3 17:20:22 CDT 2013



On 10/03/2013 04:48 PM, Jed Brown wrote:
> Tim Tautges <tautges at mcs.anl.gov> writes:
>
>> Switching your default C++ compilation type in response to one (of
>> very many) of your dependent libs changing theirs seems odd, even for
>> an otherwise-great one.  C++11 has some great stuff, but just how
>> critical is it?
>
> Did you read my first message?

Um, yes, and even waited a day to avoid getting caught up in the email barrage I expected to see but didn't :).

The ABIs are often incompatible so we
> can't reliably choose different dialects for different packages.  As
> long as the public headers are safe with C++11, those packages can all
> be used together.  If they are not, then it's the responsibility of
> those maintainers to upgrade.  Most projects should require little or no
> changes to work with both C++11 and older dialects.

Sure, but that doesn't mean they will.  To me, ABI incompatibility means I'll be more conservative about going there, 
not less, no matter how good an idea it would otherwise be technically.  One of the annoying things about C++ is that 
there's always been this piecemeal approach to compatibility, rather than being wholly compliant or not.  I'm not sure 
whether that's a problem with the standard being too liberal or the/some compiler developers being lazy.

>
> Alternatively, you can tell Jack that he shouldn't have upgraded so soon
> and then watch while he mixes himself a fancy cocktail, suggests that
> you upgrade your headers, and sits down to add non-symmetric pivoting to
> Clique. ;-)
>

I'm sure Jack is doing great stuff (hi Jack, I'm Tim...), and hopefully he's using something in C++11 that is just so 
good it's worthwhile requiring his applications to support that dialect.  I've seen too many examples though of a bit 
too much reliance on the latest features in C++, followed by complaints about how bad the compilers are on a given 
machine (just heard that very thing about 3 wks ago in fact).

>
> I.e., everyone _can_ make their headers C++11-compatible and doing it
> all now is less pain than doing it slowly, especially if it can put more
> pressure on vendors to implement and on facilities to upgrade their
> toolchains.  AFAIK, none of the major vendors have categorically
> declared that they will not implement this standard.  (Yes, Microsoft,
> I'm looking at your C99 abandonment.)
>

Sure, that's worth doing, though it won't help with elemental.

- tim

-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
  phone (gvoice): (608) 354-1459      1500 Engineering Dr.
             fax: (608) 263-4499      Madison, WI 53706




More information about the petsc-dev mailing list