11 ms·
GCC 11.1
- typon 5y agoI wish there was a C++ standard that didn't add any features, but only fixed bugs or deprecated old features, and possibly improved existed features, giving compiler writers a chance to actually catch up and developers a chance to stabilize their codebases. C++26?
- R0b0t1 5y agoSome of the additions, like coroutine support, are roughly bug fixes.
- xvilka 5y agoThere is. It's called Zig[1]. Usually I would have written Rust, but it's good to give Zig more publicity. [1] https://ziglang.org/ https://ziglang.org/
- nsajko 5y agoThis evangelism stuff has really got out of hand on HN - a whole new language is literally the opposite of what the parent asked for. To make matters worse, the languages you choose to evangelize are new/experimental, making your comment even less on point.
- accusitive 5y agoYeah. I like rust but I feel like its pushed way too hard. If its really 'that good', people will slowly pick it up. I personally don't like c++, but I wouldn't enjoy someone going on a rust thread and shilling c++. So I won't shill rust on a c++ thread. Seems similar for Zig.
- Ericson2314 5y agoIt's just shilling. OP asked for: > only fixed bugs or deprecated old features When you get right down to that, you do end up with something like Rust. E.g. C++'s move semantics are weird because for historical reasons copying is the default. Get rid of those historical reasons, and there's no reason not to do it the Rust way. 40 years of "no big breaking changes" really is a lot of cruft.
- jcelerier 5y ago> and there's no reason not to do it the Rust way memcpy everywhere is definitely not the best answer to every problem
- Ericson2314 5y agoIf you want a copy constructor, it would work like this: Copy : Clone :: Move : Relocate I.e. there would not be the presumption that everything is automatically movable or coppiable, there would be magic traits to indicate memmove / memcpy and friends, and then plain old stdlib super traits for user-defined cloning and relocating. This is the the right design for move constructors, full stop.
- FreeFull 5y agoIt's not like C++'s move semantics magically get rid of the necessity of copying data either.
- Ericson2314 5y agoI meant to write it's not just shilling.
- seoaeu 5y ago> If its really 'that good', people will slowly pick it up. Empirically, that's been happening?
- tene 5y agoAs a huge fan of Rust, I am very interested in people writing comments about what C++ does for them that I'm missing in Rust. I want more C++ shilling in Rust threads, and I don't think I'm alone. Please, give me detailed examples of how you can use SFINAE or whatever to express useful misuse-resistant abstractions that can't be expressed with Rust's feature set. Please tell me about classes of bugs you can prevent in C++ that can't be similarly prevented in Rust. Or maybe C++ isn't safer, but it's more performant? Easier to use? Easier to learn? Easier to troubleshoot and debug? I agree that the Zig comment that started this sub-thread didn't contribute to the conversation. If we disagree, although I'm not sure we do, it's in that I'd rather call for higher-effort comments about the benefits of other languages instead of fewer comments about them.
- pjmlp 5y ago- GPGPU programing ecosystem like CUDA and SYSCL (note eco-system, not just a compiler that generates PTX code) - Game engines like Unreal and Unity - GUI frameworks like wxWidgets, Qt, MFC, WinUI - Being the language of choice to contribute anything to GCC or LLVM - Being the language of choice for the native libraries ecosystem and runtime extensions to plug into Java, .NET, nodejs. - Being the language to write drivers in macOS (IO Kit/Driver Kit), and Android alongside Java (Project Treble) - Being avaialble out of the box on macOS, iOS, Windows, Android, Playstation, XBox, Switch SDKs and respective IDE tooling So you can decide to deal with some of C++ flaws, and enjoy 40 years of history, or spend part of your application development budget into building a Rust ecosytem.
- oblio 5y ago> Windows The C++ SDK is definitely not available out of the box on Windows. You have to install it (and update it manually!).
- pjmlp 5y agoOnly for those that chose the path of not using the OS vendor tools and don't install Visual Studio. Not only it is automatically selected in the respective workloads that depend on it being avaiable, it gets updated.
- dralley 5y agoOP didn't ask for a new language that is stable, they asked for a stable C++. But yes, it's true that Zig aims to be a minimal, stable language - when they go to 1.0, which hasn't happened yet. It's still changing frequently.
- overgard 5y agoSadly, I really doubt it. The standards committee seems mostly interested in adding new template metaprogramming features at this point. What I /really/ wish they would focus on is modules. 100% of C++ developers suffer from horrible compile times, and yet it seems to always get punted. (Not to mention that forcing developers to write header-only libraries to use templates pretty much makes them way less attractive anyway) Edit: maybe I'm wrong? It looks like modules are in C++ 20. No idea if any compilers are supporting them yet.
- nindalf 5y agoIsn't modules already a part of C++20?
- petters 5y agoThe standardization work for modules is done. Now all build tools and code bases need to start supporting it in a good way.
- qalmakka 5y agoModules have been released with C++20, but no compiler has a complete implementation for them yet. Also the standard library hasn't been modularized yet.
- vips7L 5y agoMSVC is expected to have C++20 feature completeness in VS 2019 16.10 Preview 3. https://github.com/microsoft/STL/wiki/Changelog#expected-in-vs-2019-1610-preview-3 https://github.com/microsoft/STL/wiki/Changelog#expected-in-...
- zxzax 5y agoHow is it possible that modules were released, if nobody has a working implementation? I was under the impression that proposals needed at least a proof-of-concept implementation from a sponsor. My exposure to this is searching the CMake tracker for this last year and seeing that it wasn't even working there yet.
- sesuximo 5y agoCompiler writers aren’t that far behind? C++17 is mostly supported. C++20 is one year old!
- SubjectToChange 5y ago"C++20 is one year old!" The ISO standard was published in December of last year. So, technically, C++20 is only four months old.
- seoaeu 5y ago> C++17 is mostly supported. For essentially any other language this would be an absurd thing to say. For those languages you wouldn't consider a feature added until it was supported by the reference compiler
- SubjectToChange 5y agoIf you are using GCC, Clang, or MSVC then the standards support is excellent[1]. But putting that aside > For those languages you wouldn't consider a feature added until it was supported by the reference compiler Well, there is no reference compiler for C++. I don't think any language with either an ISO or ECMA standard has a reference compiler or interpreter. There are gaps in support here in and there. But I would still say those mainstream compilers "support" C++17 for the same reason I would say that Chrome "supports" CSS3, despite it not implementing the full specification. [1] https://en.cppreference.com/w/cpp/compiler_support https://en.cppreference.com/w/cpp/compiler_support
- pjmlp 5y agoOnly for languages that lack multiple implementations.
- jcranmer 5y agoCompiler writers are pretty quick to add support for new features--I'd say it's about a year-ish between being added to the standard (which is not the same as the actual release it's in!) and actually being usable in a compiler. Where the delay comes into play is that most projects require a minimum support of a compiler that's several years out of date. And if you're required to support 4-year-old compilers, then C++17 features aren't going to be available, despite them being available in the newest versions of all compilers. Back in 2018, I was working on a project where I gave up and used C++17 features (constexpr if) because I knew I could get away with only supporting a Clang that's a few weeks old.
- beached_whale 5y agoPick a C++ version and use that then. Compilers are not dropping old versions of the std, but the new versions are just that new. No deprecation affects an older version of C++ and no one is forcing developers(as seen by the 20-30% that still use C++98/03) to upgrade their code bases.
- not2b 5y agoYes, all you need to do, with both g++ and clang, is to specify the version of the standard that you want. Picking a mature standard makes it likely that most bugs have been fixed.
- pjmlp 5y agoNope, Python 3 showed what happens.
- PopsiclePete 5y agoWhat happens? You become the most-widely used language on the planet? The Python 2-3 wars are over. Python 3 won.
- tsimionescu 5y agoYou get 10 years of headaches for everyone who gets close to the language. Even today, the python executable in Ubuntu is called `python3`, not `python`. To be fair though, it would be less of a problem for C++ than it was for Python, since you wouldn't have to depend on the compiler from the end-user system.
- pjmlp 5y agoI just installed Python 2.7 on my new project because some critical libraries used by the customer don't care Python 3 exists.
- PopsiclePete 5y agobackwards compatibility is a bitch. But yes, there's a reason why high-visibility C++ projects like Chrome basically white-list 30% of the language and keep it that way, to some small sub-set they feel is "good enough". The problem is the fragmentation this causes. I pick these 5 features of the language, you pick another 7, I can't use your lib, etc, etc. C++ is becoming extremely bloated. Bjarne said as much in one of his recent criticisms at the highly-specialized use-case proposals that people wanted to make "standard". I enjoyed his C++11 book but now that's probably all outdated "oh we don't do it that way anymore" stuff and I can't afford to just buy 2-3 1000-page books every year to keep up. Got better things to do.
- deleted 5y ago[deleted]
- brobdingnagians 5y agoGood to see the experimental C++23 features[1] starting to get support. Looks like literal suffixes for size_t are first. [2] [1] http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0592r4.html http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p059... [2] https://gcc.gnu.org/gcc-11/changes.html https://gcc.gnu.org/gcc-11/changes.html [3] https://en.wikipedia.org/wiki/C%2B%2B23#cite_note-1 https://en.wikipedia.org/wiki/C%2B%2B23#cite_note-1
- 3v1n0 5y agoOh, reflection! <3
- boris 5y agoIf anyone is looking for a build system to try C++20 modules with GCC, there is build2: https://build2.org/blog/build2-cxx20-modules-gcc.xhtml https://build2.org/blog/build2-cxx20-modules-gcc.xhtml There is also a repository of module examples (some trying to imitate real-world usage like distributing modules as part of a library): https://github.com/build2/cxx20-modules-examples/ https://github.com/build2/cxx20-modules-examples/
- PowerGuido87 5y agoWhere can i find build2 binaries to try this out?
- boris 5y agohttps://build2.org/install.xhtml#other https://build2.org/install.xhtml#other
- PowerGuido87 5y agoThere's no binary package for Windows apparently
- yakubin 5y agoIt took this mail a bit over 3 hours to be sent to my mailbox. (I subscribe to gcc-announce.) I'm curious what the reason for such a delay is. (Nothing wrong with the delay, just curious about the technical reason.)
- xkeysc0re 5y agoThey might be using a cron job or some other batch process to send the email to each member of the mailing list. There are limits to CC and BCC, I believe.
- anarazel 5y agoMy guess: Sending email to a lot of recipients when you're not a large email provider can end up with you getting throttled / needing to apply throttling to individual servers to prevent blocking. In the past when I still operated my own email servers I often saw list emails minutes before on e.g. gmail.
- diegocg 5y agoDo you use gmail? Gmail restricts the amount of mails that a single sender can send, so sometimes mailing lists have to retry until gmail lets them send (this is a paint point for the Linux kernel mailing list)
- yakubin 5y agoI use Fastmail.
- Decabytes 5y agoI'm naive about the language development process. I have no area of expertise in C++. But coming from a background in Python I've seen people complain about Python getting bigger and bigger, and people have been complaining about C++ being huge for even longer. In my naive opinion, It seems to me that both C++ and Python have reached a point where most people are satisfied with the features the language has. Most of the complaints are around warts in the language itself that people wish could be fixed (but can't due to backwards compatibility). My question is why the need to keep adding features? Sure if something comes out that C++ is desperately lacking, add it in. But it seems like that hasn't been the case for a while. My other question. Would it be possible for a language to work like an OS? Where there is a LTS version of the language that is supported for X years, and then a new version comes out that contains potentially (but not always if it's unnecessary) breaking changes? I guess Python was kind of an example of that with Py2 to Py3, but no one who started using python after 1.0 expected there to be a shift like that. But if from the outset there is that expectation that after 5-10 years there will be a new version that removes warts in an old version would people accept that? It seems to me that the lifecycle of a language that is successful is 1. Be the new hotness and solve a problem in the programming space 2. Gain traction and users 3. Release version 1.0, become bound by decisions that might haunt you for the rest of the programs life 4. Accumulate features, bloat and warts 5. Have people complain about warts that you can't fix due to breaking changes 6. A new language develops that fixes your warts. 7. Repeat It seems like the cognitive load from "upgrading" a language as opposed to learning an entirely new language from scratch (even if it fixes a lot of your gripes) would be a lot easier. Having been playing around with Rust for a bit, I've seen the conversation come up about warts in Rust, and I think people fear if it will eventually become another C++. I think the answer is probably yes, if it endures for a similar amount of time that C++ did
- ilkkao 5y agoI don't know what the situation is with the C++ development. But in general, based on my experience on standardization work, it's really hard to stop a committee from inventing new features when the members get paid to participate and make an impact. Maybe exaggerated but sometimes I got the feeling that some proposal existed only so that the presenter was able to justify a week in a nice meeting location like Hawaii.
- megous 5y ago__attribute__ ((malloc (mydealloc, 1))) looks interesting. Didn't know about that one.
- akira2501 5y agoLikewise, this caught my eye: As in C++, function definitions no longer need to give names for unused function parameters. Goodbye UNUSED() macro!
- mhh__ 5y agoThe changelog isn't final yet, so I'm not sure if I should link it or not, but there are some nice additions to the D frontend in this one. "Reports of my death are greatly exaggerated" - GCC
- johnklos 5y agoThe MODE_CC conversion for VAX is in this version. Yay!
- pjmlp 5y agoThe improved static analyzers is one of the features I am looking forward.