People say that C++ is on its way out, soon to be replaced by Rust because of its memory safety. Won't people be able to use A.I. to scan your C++ codebase to look for potential memory leaks/vulnerabilities? Is there even a point in learning Rust when A.I. will make C++ safer?
>>108712244>Is there even a point in learning Rust when A.I. will make C++ safer?you’re confusing greenfield with existing C++ projectsI’m not gonna bother learning Rust because if I want a Rust program, I can tell Claude to make onebut this doesn’t have anything to do with, say, having LLMs improve C++ codebases so they’re saferand I’m not sure Rust’s “the compiler makes sure you don’t have threading bugs” feature can be backported to C++
>>108712321C++ could completely backport all of rust thread safety features if lifetimes are added (which is currently planned)that said, rust doesn't prevent race conditions nor does it prevent deadlocks (deadlocks can be detected at runtime, but not in release environments).given how lifetimes should work if they make it into c++, then it's very easy to write a static analysis tool (probably will be added to mainstream compilers under -Wall) that detects data races and other trivial threading bugs.
>>108712244Nodody trusts AI.
>>108712343that sounds great for projects that’re too risky to be rewritten in Rust
>>108712371You'd still need to update your projects to use lifetimes, which for large projects is unrealistic.Even google sees this shortcoming, which is why their language has to interop with CURRENT c++ code, not through an ABI, but be somewhat backward compatible with existing c++ codebase, because rewriting to modern c++, or rust would be too expensive/time consuming.
>>108712343you got zero of the details right. impressive.
>>108712244At most companies, most C++ projects look like this:-Source files with ten thousand lines of code.-Class, function, and variable names full of abbreviations.-Lots of things hidden behind untraceable macros.-The build system is some custom, hacked-together mess.It's not really ideal for working with AI.
>>108713099can’t be any worse than COBOL: https://claude.com/blog/how-ai-helps-break-cost-barrier-cobol-modernization
>>108713099you forgot the day long rebuild when you accidentally edit a header parent to all source files and tests that have to run on a dedicated server for days
>>108712244C++ always sucked. Why save it?
>>108712343c/c++ has all safety but you have to use tools like clang address/thread sanitizer
>Won't people be able to use A.I. to scan your C++ codebase to look for potential memory leaks/vulnerabilities?Some, but not all. Remember Rice's Theorem.
C++ is the hero you retards don't deserve, and it's not going anywhere
>>108712244>C++ is on its way out soonYea, back in ancient Greece they used to tell stories about how C++ was only going to be around for two more weeks
>>108712244LLMs often emit shit & unsafe code.If you do go that route, might as well pick a language with a strong type system and compile-time safety guarantees.If anything, this is a case for Rust, not C++.
>>108714458Midwit detected. Absence of sanitizer findings is not the absence of memory or data race bugs.
>>108715043address/ub/thread sanitizer uses exactly the same underlying llvm functionality as rust does
>>108715097are you the same /g/eet as >>108712343? impressive levels of "winging it" retardation in both
>>108712244C++ cannot be replaced nigger. Rust hasn't even reached it's first real hurdle. They will have to go through at least a hundred.Replacing C++ with Rust is like thinking every country on planet earth can de-google.Spoiler not a single one can.
>>108712244Sepples has been beyond saving for at least a decade.
>>108715000This is the most retarded metaphor I've ever read.
>>108715097You're fucking retarded. I retract calling you a midwit.
>>108715097you are retarded.rust does have runtime sanitizers, like deadlock detectors in debug builds, but most of it's safety comes from it's type system, which is what allows a bc to be useful in the first place.
>>108715193take your meds xister
>>108715216clang sanitizers detect compile time bugs + runtime bugs
>>108715097Are you fucking stupid? Those are runtime sanitizers. We're talking about Rust's static compile-time guarantees.
>>108715373https://clang-analyzer.llvm.org/
>>108715242anon, that's not how sanitizers workasan tsan and others are meant to be embedded in builds that you use for unit testing. for a bug to be detected, you must trigger it at runtime, therefore it only make sense when you test for full coverage.>>108715400peak retard, that's not a sanitizer. also clang-analyzer (and gcc -fanalyze which is kinda better) requires you to annotate heavily using non standard attributes. static analyzers don't detect overflow, oob access and data races.
>>108712244nahC++ is forever
>>108715188It's not a metaphor, it's hyperbole. Don't use words if you don't understand them.
>>108712244>C++ is on its way out, soon to be replaced by Rust because of its memory safetyno, because of MIT license
>>108715744>what happens when a wintard /g/eet nocoder gets its info from zog e-celebs
>>108715575