Live data from Hacker News

C++20, How Hard Could It Be

docs.google.com

441–444 of 444 posts

Re: C++20, How Hard Could It Be

#441

Earlier quoted context omitted.

The real solution, which decades from now will be the eventual common-place, but no one dares to imaging the possibility today is that when languages deprecate a feature, the compilers deliver code-mods that migrate your code-base perfectly. But people are afraid of going that route because of the bad press around Python 2 / 3. We need a new generation of developers that don't remember that. Today, there's already st…

Transformations are difficult. Rust provides best effort transformation for its Editions (which only touch syntax) in cargo fix --edition, but even that's only best effort. If a proc macro does something ludicrous (see Mara's whichever-compiles! macro for example) how can the transformation hope to keep up? C++ versions are in much deeper, they not only change the language syntax, but also semantics of existing featu…

clang-tidy is such a tool, provided with a C++ compiler - although incomplete

Re: C++20, How Hard Could It Be

#442

Earlier quoted context omitted.

> Historically after you create object files the linker doesn't care what c++ standard the source was. Mechanically this is true, but just because we can link object files together doesn't mean the resulting program makes sense. Suppose I have an object file I made with GCC's copy-on-write C++ 98 strings and then I linked that to an object file I made with GCC's modern C++ 11 short string optimised strings. If these…

When gcc broke the string ABI they made sure that code that uses one version wouldn't link with code that uses the other one.

Only for the most common case. Try e.g.

  struct muhahaha {
    std::string member;
  };
library.cpp98:

  oops(muhahaha param);
program.cpp20:

  int main() {
    oops({"this will link just fine and there will be nothing warning you about your fate"});
  }

Re: C++20, How Hard Could It Be

#443
> Problem: Early test showed release binary size increased by 0.9% (Win)

I guess once again you do actually end up paying for what you don't use.

> Solution: Don’t care?

:(

Would have been nice if they at least analyzed where the increase was coming from. Maybe operator?

Re: C++20, How Hard Could It Be

#444
post #49

Earlier quoted context omitted.

I think the main differentiators for clang were more readable error messages than the mess GCC had (and still has), and faster compilation (here it lost a bit of its advantage over time). I haven't heard of anyone praising it over GCC based on standard compliance. That said, when I explore weird edge cases in how differently Clang and GCC parse source code, and how differently they optimise it, in my experience Clang…

> I haven't heard of anyone praising it over GCC based on standard compliance. Back in the day (C++0x era), it was near bleeding edge. Clang had all the proposed 0x features ready to go before C++11 was released. It took a while for GCC to get all the C++11 features after the release.

> Clang had all the proposed 0x features ready to go before C++11 was released.

Except garbage collection, of course.

Post reply on HN