News for hackers. Stuff that matters.
Re:Ask HN: Are there any good reasons to use C++ over Rust f... by adamjs on Thursday February 15, 2024 @04:04PM (#39388827)
Every language has its own merits, there's no single language that's universally the best for every task.

With that said, C++ and Rust both occupy similar domains (high-performance, low-level, often interacts with OS syscalls or hardware).

Pros of C++:

- More mature, excellent library ecosystem, decades of code to reference from.

- Syntax is arguably easier to read and write

- It's very popular (top 6th language on GitHub), lots of talent to hire from.

Pros of Rust:

- Memory safety, it's much harder to introduce bugs of a certain type.

- The borrow checker makes it easier to reason about lifetimes of objects.

- Cargo is great for pulling in libraries (just needs more of them).

For me personally (graphics / game-dev), cost and speed of development is the deciding factor. I use both: C++ by default, and Rust for low-level, safety-critical code.

Re:Ask HN: Are there any good reasons to use C++ over Rust f... by dralley on Thursday February 15, 2024 @04:53PM (#39389557)
>- Syntax is arguably easier to read and write

This generally comes down more to familiarity than "ease". C/C++ are familiar.

Re:Ask HN: Are there any good reasons to use C++ over Rust f... by nickpsecurity on Thursday February 15, 2024 @04:25PM (#39389137)
I usually hear about people using Rust with C. You use Rust and C++. If you use them together, how easy is it to call Rust from C++ and vice versa? And can you do that with their standard interfaces instead of watering it down to the lowest, common denominator?