5 ms·
Why would anyone use Rust when C++ is here and is already mature?
by Mr_lavos 10y ago
Why would anyone use Rust when C++ is here and is already mature?
- sgift 10y agoI haven't used C++ in a long time, but ... can I still use standard language features (Templates) and my code will compile with one compiler, but not the other? That would be a big reason in my opinion.
- AlexeyBrin 10y agoGCC and Clang are 100% C++14 compatible, not sure about MSVC but I think it is close to 100% compatibility.
- mfukar 10y agohttps://msdn.microsoft.com/en-us/library/hh567368.aspx https://msdn.microsoft.com/en-us/library/hh567368.aspx
- gpderetta 10y agoWhy would that be a reason? There is still only one rust compiler.
- sgift 10y agoI'd rather have one C++ compiler that works great on every platform than multiple ones that only work on one (or two) platforms.
- gpderetta 10y agoGCC is a great C++ compiler that works on more platforms than the rust compiler. Clang, another great C++ compiler, works on at least as many platforms as the rust compiler. Again, why would this be a reason to prefer rust over c++?
- carussell 10y agoOn the off chance that you aren't being deliberately obtuse, here's what's going on: If, given two situations 1. The the set containing compilers for language L is size 1, and that compiler works on multiple platforms; or 2. The set of compilers is > 1, but there exists at least one compiler in the set which is a) popular for use with language L b) not fully interoperable with the other compilers from the set that satisfy (a); then situation 1 is the preferable one Or to put it another way, nobody complains about code not working with compilers that don't exist.
- gpderetta 10y ago3. The set of compilers is > 1, and there exist at least a popular compiler that works on multiple platform. Rust is in 1 of course. C++ is both in 2 and 3. In particular for C++, the compiler in 3 works on a strict superset of all the platforms supported by rust. As you are free to support only this C++ compiler and ignore every other C++ compiler (you must not care about multiple implementations otherwise you wouldn't think that 1 is a good solution), it seems to me that 3 is strictly better than 1. edit: I do concede that the existence of a popular but non-interoperable compiler[1] does fragment the community and it has been an issue in C++. Things are getting better though, and if rust becomes popular enough it might become an issue there as well. [1] We all know which compiler I'm talking about.