[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: savecpp.jpg (45 KB, 686x386)
45 KB JPG
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++ projects
I’m not gonna bother learning Rust because if I want a Rust program, I can tell Claude to make one
but this doesn’t have anything to do with, say, having LLMs improve C++ codebases so they’re safer
and I’m not sure Rust’s “the compiler makes sure you don’t have threading bugs” feature can be backported to C++
>>
>>108712321
C++ 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.
>>
>>108712244
Nodody trusts AI.
>>
>>108712343
that sounds great for projects that’re too risky to be rewritten in Rust
>>
>>108712371
You'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.
>>
>>108712343
you got zero of the details right. impressive.
>>
File: REEEEEEE.png (155 KB, 720x506)
155 KB PNG
>>108712244
At 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.
>>
>>108713099
can’t be any worse than COBOL: https://claude.com/blog/how-ai-helps-break-cost-barrier-cobol-modernization
>>
>>108713099
you 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
>>
>>108712244
C++ always sucked. Why save it?
>>
>>108712343
c/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.
>>
File: 1773540704341570.jpg (72 KB, 600x800)
72 KB JPG
C++ is the hero you retards don't deserve, and it's not going anywhere
>>
>>108712244
>C++ is on its way out soon
Yea, back in ancient Greece they used to tell stories about how C++ was only going to be around for two more weeks
>>
>>108712244
LLMs 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++.
>>
>>108714458
Midwit detected.
Absence of sanitizer findings is not the absence of memory or data race bugs.
>>
>>108715043
address/ub/thread sanitizer uses exactly the same underlying llvm functionality as rust does
>>
>>108715097
are you the same /g/eet as >>108712343? impressive levels of "winging it" retardation in both
>>
>>108712244
C++ 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.
>>
>>108712244
Sepples has been beyond saving for at least a decade.
>>
>>108715000
This is the most retarded metaphor I've ever read.
>>
>>108715097
You're fucking retarded. I retract calling you a midwit.
>>
>>108715097
you 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.
>>
>>108715193
take your meds xister
>>
>>108715216
clang sanitizers detect compile time bugs + runtime bugs
>>
>>108715097
Are you fucking stupid? Those are runtime sanitizers.
We're talking about Rust's static compile-time guarantees.
>>
>>108715373
https://clang-analyzer.llvm.org/
>>
>>108715242
anon, that's not how sanitizers work

asan 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.

>>108715400
peak 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.
>>
>>108712244
nah
C++ is forever
>>
>>108715188
It'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 safety
no, because of MIT license
>>
>>108715744
>what happens when a wintard /g/eet nocoder gets its info from zog e-celebs
>>
>>108715575



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.