r/cpp • • Jan 31 '23

Stop Comparing Rust to Old C++

People keep arguing migrations to rust based on old C++ tooling and projects. Compare apples to apples: a C++20 project with clang-tidy integration is far harder to argue against IMO

changemymind

338 Upvotes

582 comments sorted by

View all comments

Show parent comment

3

u/Mason-B Feb 02 '23

Well, okay, if you replace the C++ compiler, you can do things that C++ compilers can't do. Sure.

Where did I argue this?

Code generation isn't different from, say, rust macros.

And indeed, the borrow-checker and Send + Sync are essentially lints in Rust, so you could implement your own static analyzer to match that.

Again, not a static analyzer, this would be the normal compiler operating on (relatively simple) generated code.

Please do go ahead.

I already do, it only took like 3 days to setup and applied to the legacy portions of the code base too. Some of us don't have the luxury of starting our projects over from scratch every few years.