←back to thread

In Defense of C++

(dayvster.com)
185 points todsacerdoti | 1 comments | | HN request time: 0.197s | source
Show context
fithisux ◴[] No.45268130[source]
"Rust shines in new projects where safety is the priority, while C++ continues to dominate legacy systems and performance-critical domains."

the truth

replies(2): >>45270895 #>>45271002 #
charlieflowers ◴[] No.45271002[source]
> "while C++ continues to dominate ... performance-critical domains"

Why performance-critical domains? Does C++ have a performance edge over Rust?

replies(1): >>45273027 #
fithisux ◴[] No.45273027[source]
That is what the article says.
replies(3): >>45278386 #>>45279741 #>>45281471 #
1. tialaramex ◴[] No.45279741[source]
But you stated it was "the truth" and so we might reasonably wonder why you think so, unless it's that you just believe anything you read.

"ABI: Now or never" by Titus Winters addresses some perf leaks C++ had years ago, which it can't fix (if it retains its ABI promise). They're not big but they accumulate over time and the whole point of that document was to explain what the price is if (unlike Rust) you refuse to take steps to address it.

Rust has some places where it can't match C++ perf, but unlike that previous set Rust isn't obliged to keep one hand tied behind its back. So this gently tips the scales further towards Rust over time.

Worse, attempts to improve C++ safety often make its performance worse. There is no equivalent activity in Rust, they already have safety. So these can heap more perf woes on a C++ codebase over time.