News for hackers. Stuff that matters.
Re:Ask HN: Why do you use Rust, when D is available? by secondcoming on Friday June 12, 2020 @05:21AM (#23497485)
I've been writing C++ professionally for 16 years. I'm doing it right now in fact, but snuck on to HN while a build is underway.

OP is right, unfortunately. C++ is a dying language. Mozilla, Microsoft and Google are all looking at Rust. Why? Because it's probably makes more sense to rewrite a buggy C++ component in Rust instead of updating it to use modern C++ (where admittedly, you have to go out of your way to get things wrong). The damage has been done.

I'm also concerned about our ability to hire in the future. C++ devs will either be too expensive, or just not there since it's not an attractive language any more.

I'm not a Rustafarian either, I've actually never used it but it would be negligent of me to not look at it. One concern I have with it is that the eco-system may be full of poor-quality ports of C/C++ libs, because that's how people work when they learn a new language.

Re:Ask HN: Why do you use Rust, when D is available? by mantap on Friday June 12, 2020 @05:43AM (#23497587)
C++ was a dying language in the 2000s. But they turned it around with C++11. Now it has iterative 3 yearly updates and it's getting pretty good.

It's far too premature to declare its death. The pace of development of C++ is decently fast and there's many stakeholders with millions of lines of C++ who are interested in C++ not dying. C++ is taught in universities around the world so the chance of C++ developers becoming expensive is low.

Re:Ask HN: Why do you use Rust, when D is available? by ncmncm on Friday June 12, 2020 @02:46PM (#23502357)
In fact, the number of C++ programmers is growing faster than ever. This is evident in the growing number and size of C++ conventions. (Bulgaria has its own, now.) Even ISO C++ Standard committee attendance is reliably a lot more than every previous meeting, even when held in inconvenient places. Attendance will hit 500 soon. The amount achieved at each meeting grows accordingly. Proposals get more scrutiny and draw on more experience.

To suggest C++ is a dying, slowing, or stagnant language is objectively delusional. The language is healthier than ever, and going gangbusters.

Re:Ask HN: Why do you use Rust, when D is available? by Aeolun on Friday June 12, 2020 @08:24AM (#23498507)
The C++ that they teach you in universities barely gets you started. I wouldn’t count on those for a steady supply.
Re:Ask HN: Why do you use Rust, when D is available? by gnulinux on Friday June 12, 2020 @02:05PM (#23501916)
The C++ they teach in universities is either just C, or putting Java spin on C (C-with-classes). I've never seen a decent "modern C++" class taught in universities.
Re:Ask HN: Why do you use Rust, when D is available? by mantap on Friday June 12, 2020 @08:46PM (#23505574)
Sure, but that's nothing a few years in the real world can't fix. The point is that C++ programmers are not some rare breed of neckbeard that are gradually going extinct. They are being produced en mass.
Re:Ask HN: Why do you use Rust, when D is available? by pjmlp on Saturday June 13, 2020 @11:45AM (#23510231)
I love that Java spin on C remark, given that stuff like Turbo Vision, MFC, OWL, PowerPlant, Motif++, CORBA, COM, VCL, SOM, CSet++, POET precede Java for several years, some almost a decade.
Re:Ask HN: Why do you use Rust, when D is available? by pjmlp on Saturday June 13, 2020 @04:08AM (#23507765)
While we see some adoption of Rust from Google and Microsoft, all their new releases are heavly focused on C++.

React Native, the new Games SDK for Android, WinUI 3.0 release, lifetime analysis support for Visual C++ and clang and lets not forget they are two major contributors to ISO C++.

While the Rust/WinRT efforts from Kenny Kerr are welcomed, that it is just yet another option alongside C#/WinRT, C++/WinRT, Python/WinRT and JavaScript/WinRT.

Re:Ask HN: Why do you use Rust, when D is available? by taylodl on Friday June 12, 2020 @08:43AM (#23498634)
COBOL has been dying since the early 80s yet to this day more than 80% of all daily business transactions are processed in COBOL and 5 billion lines of new COBOL are written every year. If this is what a dying language looks like then yes, C++ is a dying language.

P.S. I'm not a COBOL programmer nor have I ever been a COBOL programmer.

Re:Ask HN: Why do you use Rust, when D is available? by blub on Friday June 12, 2020 @12:00PM (#23500527)
The only language that one can honestly say that is dying (if not already dead) is VisualBasic. Perl and Delphi are probably going to continue to decline. Objective-C will be obsoleted by Swift some day, but is still relevant. Ruby's not too hot now, but far from dead AFAIK.

Other than that it's nonsense to say that X is dying.

Re:Ask HN: Why do you use Rust, when D is available? by secondcoming on Friday June 12, 2020 @12:34PM (#23500916)
C++ is being blamed for allowing people to write buggy, insecure programs. In my mind, that's different to just becoming unpopular; it's dying because it's too dangerous and too complicated.

Sure, it'll stick around for some years yet but all those jobs will become maintenance jobs. Very little greenfield projects will elect to use it outside of niche areas (games and maybe embedded - UK salaries for embedded dev are terrible). Both C++ and Rust can use LLVM, so the generated code is likely to be the same.

If you were starting a greenfield project today why would you choose to do it in C++?

I forgot to mention Go too.

Re:Ask HN: Why do you use Rust, when D is available? by ncmncm on Friday June 12, 2020 @02:55PM (#23502438)
In fact, essentially all new development in the highest-paid financial, HPC, CAE, telecomm, aerospace, and ML fields is pure C++. Rust is not a blip in any of them, and will not be for years to come. C is dead there (except in aerospace and telecomm), Go is nonexistent, and Java is mentioned on rare occasions.

To suggest C++ usage is in decline is, objectively, nothing short of delusional. For Rust, C++ will the one to beat in ten and twenty years, provided not too many have already skipped onto some new hotness.

Rust is an objectively better design than anything else that has arisen in 30+ years. That doesn't guarantee success.

I used to hope a better language would displace C++, and for a time thought Rust might be it, but that better language turned out to be C++ itself. Nothing else is even on the horizon.

Re:Ask HN: Why do you use Rust, when D is available? by krapht on Friday June 12, 2020 @02:37PM (#23502263)
My company starts new programs in C++ because everyone knows C++ already, we write modern C++, our libraries are written in C++, and our bugs are mostly not memory safety issues.
Re:Ask HN: Why do you use Rust, when D is available? by bigjake on Sunday June 21, 2020 @09:12PM (#23596635)
I would choose C++ because the tooling is superb, talent is widely available, it is performant, there are libraries for pretty much everything, and it's a great language.

Oh and by the way, LLVM is 100% c++.

Saying it is too dangerous and complicated is absurd. It is easy to write safe code in C++, having been doing it for almost 30 years.

You are throwing around lots of assertions - challenge you to back them up with real data.

Re:Ask HN: Why do you use Rust, when D is available? by mbrodersen on Sunday June 14, 2020 @12:16AM (#23515077)
The world runs on C/C++ code. And new C++ projects are started every single day.
Re:Ask HN: Why do you use Rust, when D is available? by bigjake on Sunday June 21, 2020 @09:05PM (#23596599)
I don't understand your claim that C++ is dying. Do you have data to back this up?