Re:Bjarne Stroustrup's Plan for Bringing Safety to C++
by r0ze-at-hn on Monday October 30, 2023 @12:29AM
(#38065694)
Option 3) Most businesses have a lifetime, most software has a lifetime, and one day they are run for the very last time. The same will happen for code written in C++, most of it will simply die. Some might live on in a GitHub repository, never to be compiled again.
Option 4) The business core is turned into a library. Everything from the command line tools to UI all wrap this in other languages. Everything that is not the core is deleted.
With the C++ committee after the last two decades I am firmly in the I'll believe [shiny feature] when I see it camp.
Re:Bjarne Stroustrup's Plan for Bringing Safety to C++
by pjmlp on Monday October 30, 2023 @06:32AM
(#38067680)
COBOL 2023 was just ratified, so C++ still quite a road ahead of itself even if we rewrite everything starting today.
Re:Bjarne Stroustrup's Plan for Bringing Safety to C++
by tobias12345 on Monday October 30, 2023 @06:48AM
(#38067801)
> There is no "rewrite it in another language" option.
How about "Wrap your C++ code in FFI wrappers and use it from a safer language"?
It is conceptually not much different to "rewrite all your C++ code to be profile compliant" -- which will involve wrapping existing "unsafe" C++ code you can not just port over to mark it up in such a way that tooling can reason about it better.
But there's billions (?) of lines of existing C++. For those projects, there are two options: (1) improve compiler static analysis, possibly incrementally update it with something like 'profiles'. (2) Do nothing.
There is no "rewrite it in another language" option. Those are your choices, and even (1) is a stretch.
So I do think we should be moving forward on both fronts - improve C++ so that existing code can be made safer, as well as push the envelope with newer safer languages.