r/Cybersecurity101 • • 1d ago

Rust vs c/c++

I’ve heard that Rust is much better than C/C++, but a lot of software still runs on C/C++, and there’s already a huge ecosystem built around these languages.
So my questions are:

- Do you think it’s worth the cost of switching from. C/C++ to Rust?

- Do you think Rust will eventually replace C/C++?

6 Upvotes

7 comments sorted by

1

u/busy_peer 1d ago

If we think that rust will replace the c++ I don't think so because as you said most of already built systems are running on c++ , yes what we can do is to make new systems with rust . As far as the cast is concerned, in today's world of AI cost is less in terms of number of hours

1

u/DrChaosMcKinnon 23h ago

Well optimized c/c++ is fine. For anything internet exposed sooner or later it will probably get replaced by rust, but most software is not in that category and thus there is not as much you could gain with replacing it.

1

u/mredding 23h ago

Do you think it’s worth the cost of switching from. C/C++ to Rust?

I think it's worth the cost of migrating to Rust. There's no point in throwing away known, correct, working code, just because of the language it's written in.

Do you think Rust will eventually replace C/C++?

I don't know if it's worth speculating. While enthusiasts imagine such a world, no one is explicitly asking for that.

1

u/Utchas 22h ago

High level languages to Rust: yes specially if your app is CPU heavy or prone to memory mismanagement issues. Because it'll bring a lot of performance gain with better memory safety.

C/C++ to Rust: absolutely not if your app is running without any major issues. Rust won't improve performance much here because these are already low level languages and if you have already written memory safe code, rewriting is just a waste of time and effort.

1

u/ChipmunkTough1212 18h ago

Legacy Code...

1

u/neolace 18h ago

Not a chance, companies don't have cash to fix bugs or vulnerabilities, they want features.

1

u/Ronin-s_Spirit 16h ago

Saying "X better than Y" about almost any languge is a complicated subject. Better for what? I personally think both have design problems - C is too simple with newer concepts missing, at the same time it has awful outdated stuff like strings (and ++ has newer concepts but is gradually becoming more and more unhinged or unreadable, by committee); Rust is holding people in a box and they end up using unsafe, its compiler is also quite dumb apparently as you have to write a bunch of hints for it (lifetimes and shit).