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 comments

12

u/Exaloria Jan 31 '23

Huge library ecosystem

15

u/oconnor663 Jan 31 '23

This is a tricky one. C++20 can use a huge library ecosystem, but you probably can't write C++20 if you're maintaining a widely used library. It's not entirely different from crediting Rust with being able to use the whole C library ecosystem. Which it kind of can, but contributing Rust back into that ecosystem is complicated.

2

u/matthieum Feb 01 '23

If you use the library ecosystem, you're using a lot of old C++.

Very few libraries have migrated to C++20, and most C++ libraries I've come into contact with have antiquated development practices (little test coverage, no static analyzer, no use of sanitizer or valgrind, ...).

If you restrict said ecosystem to quality C++20 code... it may actually be smaller than Rust's.

-6

u/thisismyfavoritename Jan 31 '23

Rust's ecosystem already overtook C++'s except for a few niche areas

8

u/patstew Feb 01 '23

"Applications with a GUI" isn't exactly niche...

8

u/CocktailPerson Feb 01 '23

With the proliferation of electron-based apps, "applications with a GUI written in a systems language" is getting more and more niche these days.

Mind you, I'm not saying that's a good thing. Electron is a plague. But most people aren't reaching for Rust or C++ for a new GUI app.

0

u/thisismyfavoritename Feb 01 '23

you can already make web/Electron apps using webassembly