Live data from Hacker News

C++20, How Hard Could It Be

docs.google.com

91–100 of 444 posts

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

#91
post #58

Earlier quoted context omitted.

I wonder how up to date is the old belief of better error messages. The was some great redhat blogs about structured error messages in newer GCC.

Ok, that's kinda true I suppose; I remember that GCC's error messages have indeed gotten better after a major version release. Also, when you say structured, do you mean errors over LSP, or do you mean more structure in the formatting when reporting in CLI?

I meant in cli a bit like rust arrows logs

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

#92
Not mentioned here, but some stuff we bumped into:

* std::filesystem::path broke some APIs with the introduction of u8string.

* some deprecated interfaces of std::allocator got removed.

It was easy enough to resolve and we are in the process of switching to C++20.

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

#93

So, it seems most problems are C++ making things extra bureaucratic and annoying. Cool The "pre/post increment of volatiles is deprecated" sounds like a huge pain. I can't imagine a worse waste of developer time than fixing such a minor thing (and to be fair C allowing both a++ / ++a should never have existed)

well to begin with if you're using volatile, you're probbaly doing something wrong already. The valid use cases for it are ridiculously few.

But if you're using volatile correctly, then there's nothing wrong with ++*v.

I was wondering about that slide that says the meaning is unclear, I don't see what's unclear about it. What particular assembly instructions it translates into is irrelevant. It's not like ++ is guaranteed atomic or anything.

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

#94
post #51

Wait, so the words "concepts" and "requires" were newly made keywords, and this breaks code, but the words "yield" and "await" were determined too important and too common to standards members that they needed to be renamed to the horrifically ugly "co_await" and "co_yield"? Also, last time I actually tried to use C++20 none of the standard library implementations had std::format; has this changed now?

One day in the far away future the standard C++ hello world will use 'import std;' and 'std::print' and it will be glorious.

When I was going to university the computer science department's primary system had two compilers available, GCC 2.96[0] and TenDRA. GCC was generally more popular but it didn't have std::string and any code that threw an exception would crash, so adventurous students would use TenDRA for development.

One of the stranger behaviors of TenDRA was that it put all standard library symbols, including the C headers, into namespace std. A hello world in TenDRA looked like this:

  #include  // no  available

  int main() {
    std::printf("Hello, world!\n");
    return 0;
  }
It was not glorious. If anything ... the opposite. When TenDRA deigned to compile your program it would generally work (excepting bugs in the code itself), but getting it to accept any sort of third-party code was impossible because of the std namespace thing.

I ended up writing a bunch of utilities for strings, including a unit testing library that spawned each test as a subprocess (to avoid exceptions) just so I could use GCC instead.

[0] There is no such version recorded on the GNU project website.

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

#95
post #62

Earlier quoted context omitted.

gcc is better than clang on every metric. Sorry, it's the facts. ¯\_(ツ)_/¯

Whoa, really? Since when?? After a lifetime of using GCC, I (like many others) moved to clang a few years ago, out of frustration with the slow development of GCC, a desire to use new C++ features, and stayed because of the superior error messages and, in my use cases anyway, superior code generation. In addition, I gather it's a much cleaner and easier to maintain code base. As a result, we get to have cool things l…

Gcc pretty consistently delivers slightly faster code.

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

#96
post #41
post #8

Is one release really causing so many problems? I thought C++ treated backwards compatibility as a holy thing.

All languages break backwards compatibility, just not to the extent of Python 3. Heck even Go folks are discovering their stable guarantee isn't as stable as they thought.

Re Go, sure, but most (all?) of those have to do with security updates that may impact features. The discussion is how to make them less painful or opt-in/out in the standard library. None of this has to do with the language itself.

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

#98
post #22

Is there a case for or against incrementally adopting Rust ?

Which of these things is Rust immune to? How stable is it over a 10, 15, 20 year life? How old can the code be that Rust compiler still compiles and links successfully and bug-free?

Ok here come the rust apologists.

Well when rust makes changes every 6 weeks we all hold hands and update all of our code.

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

#99

Earlier quoted context omitted.

One day in the far away future the standard C++ hello world will use 'import std;' and 'std::print' and it will be glorious.

When I was going to university the computer science department's primary system had two compilers available, GCC 2.96[0] and TenDRA. GCC was generally more popular but it didn't have std::string and any code that threw an exception would crash, so adventurous students would use TenDRA for development. One of the stranger behaviors of TenDRA was that it put all standard library symbols, including the C headers , into…

GCC 2.96 was a development version that incorrectly got released by Redhat on Redhat 7 (and possibly other distros).

https://gcc.gnu.org/legacy-ml/gcc-announce/2000/msg00003.htm...

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

#100
post #56
post #38

Earlier quoted context omitted.

Rust does well on this front. There's a new release every 6 weeks, and majority of users jump on it straight away (to complete shock of everyone not used to it). Rust has editions which keep old code working without any changes, even if you mix it with new code, even if you do it with macros. It has rustfix that automatically migrates majority of the old code. Rust has a standard project layout, standard test runner,…

This how i got traumatized by rust: i had a simple task, 1 day long. Write a routine, use a standard output format, theb parse the results. It was to be presented in front of 20 peers the next day. Decided to try the last part in rust... Did a few tutorials, not all of them "worked," but i scratched my head and moved on. Started writing the parser. No examples worked. Couldn't put together any reference code. Even co…

You were set up for failure: "do something for tomorrow in a new complex technology, and present in front of multiple peers".

Your solution - to use a different technology designed with different requirements, that you were already familiar with, and that you knew could do the job, was the right solution in your situation.

Your conclusion could be revised and improved.

Post reply on HN