Hacker News new | ask | show | jobs
by tobias12345 969 days ago
So your argument is: C++ will be a great legacy language and we will enjoy its memory bugs for decades to come?

I really hope it can do better than that.

Note that Window ships a kernel driver written in Rust already, Linux (== ChromeOS and Android) are working to add rust support and iOS is moving towards Swift everywhere. Other languages are closing in on all the use cases you mentioned.

1 comments

One kernel driver is nothing in 28 years of development, the head of Windows security (David Weston) is the very first to admit C++ is not going away from Windows that soon.

I am fully aware of all those efforts, several links have been posted into HN from me, you can find all of them on my submission history.

A language alone, without the ecosystem, certified compilers and plenty of other industry needs isn't enough, it takes time.

Food for thought, despite all the best efforts and almost painless compatibility, after 40 years, there are still industries that would take C over C++ without wasting a single second thinking about it.

I am not arguing that there is a lot of C++ code and that this code will be around for a long time. But I would prefer to see C++ as a language with a future and not as the language some well-paid dinosaurs use to keep the legacy code-base running while all the cool stuff happens elsewhere. "C++ will make a great legacy language" is underselling it.

But we might be wrong: Some government or consumer org or something _could_ step in and start to require the use of memory safe languages or just discourage the use of C/C++ in anything they buy. That would hasten the replacement of C++. I am afraid this is getting more likely based on how the C++ community handles growing concerns about memory safety outside of the development communities.

I have seen presentation on safety by people I respect for their contributions to the C++ language that all said a combination of these things:

* you said "C/C++", so you must be clueless * you do not know what safety means, let us explain that to you * everybody else does it wrong and is not really secure either * we can not solve the problem, because everybody uses C++ for the tricky bits that other language can not do because they are oh so safe * other languages are not as safe as they claim as they can all call into C++ * it will act swiftly, it will probably only take us a decade or so * you can use some extra tools somehow, that somebody will probably write * asking devs to follow our recommendations has never worked before, so we need something to enforce things. Let's ask all devs to please use this new thing. * Devs unfortunately do not follow best practices and there is nothing we can do about that

That does not seem to be a very convincing communication strategy to me, even less so when other communities show that real improvements are possible.