by ncmncm · 5y ago · 0 comments
A healthy response to news of another compiler for your new language is, "Wonderful! People are demonstrating their belief in the future of our language with a big time investment! Another compiler will help us validate our language specification, which will be badly needed when we go to ISO to ask for a Rust standard Working Group."
It is just possible that a second compiler could be twice or (as happened with Pascal and C++!) 100 times faster. Faster builds would mean thousands of hours saved for users of the language—even, potentially, for people working on the old compiler!
A second implementation of the standard library could offer similar benefits.
More implementations is an absolute prerequisite to language maturity. All languages not doomed get them. It will be a net good for Rust not to be doomed.
That said, I think that C++98 is a terrible language. I would understand targeting C++11. I would understand targeting the last version of OCaml which GCC4 can build. But the number of footguns C++98 introduces would make it for me a worse choice than plain C.
But with modern-style library support, C++98 can be quite safe and usable, at least single-threaded. But some things are unavoidably verbose. The only serious functional lack is moves, but that is a performance optimization. C++98 code can be upgraded to current whenever the perceived need to hang back dissipates.
That said, implementing another compiler just for the sake of bootstrapping convenience would be powerfully silly: if you code a new Rust compiler, it should be the very best Rust compiler you can write, and better on at least some axes than the flagship one.
Coding it in C++17 or 20 would be just good sense: Religion notwithstanding, C++ is a mature and powerful language well suited to the task.
One real peculiarity of churn around bootstrapping is that, given good support for cross compilation, you hardly ever need to bootstrap at all. So if that is a thing that worries you, work supporting cross-compiling is your most productive course.
Just because it is C++98, it isn't a recipe to write C with a C++ compiler.
Also, the Rust community at large is not at all enthusiastic about handing the language over to ISO. The design-by-comitee-based, incrementalist, waterfall throw-it-over-the-wall-every-3-years approach is pretty much the exact opposite of the continuous delivery-based way Rust is developed, and arguably one of the main reasons why C++ sucks.
What does it mean when you feel a need to lie about your perceived competition?
In fact, there is no such competition: literally hundreds pick up coding C++ professionally for each individual who so much as tries out Rust. The fast rise of Rust has no detectable effect on the growth of C++ usage, even 40 years on. Rust's and C++'s coexistence will last for as long as Rust is used at all.
You are welcome not to like C++, but lying about it says more about you than about it.
The fate of Gcc-Rs will be determined by future events unknown to you or to anyone else. It could become critically important to Rust's own future, someday.
According to the StackOverflow survey, C++ is at 25% popularity (which btw means C++ barely misses being in the Top 10 and fails to outdo PHP) and Rust is at 5%. If you restrict this to professional coders, then C++ falls to 20% popularity and Rust is at 4%, so roughly the same difference; 5 coders saying they use C++, 1 coder saying they use Rust.
Now in the same survey, people could also rank languages into loved/wanted/dreaded. In this section Rust has been the top loved language for 5 years straight (80%~), and C++ usually only breaks the top 10 in the dreaded category.
That means that for every coder that says they love C++, there is two coders saying the love Rust more.
That there is hundreds picking up C++ over everyone picking up Rust is a dream fantasy of someone stuck in the 2010s.
The great majority of C++ users probably do not look at StackOverflow, never mind participate in its surveys. (I don't.) It is possible the majority have never even heard of it. The principle online reference for C++ coders is cppreference.com.
You do not need to love C++ to earn your living with it: it is known to work. Objectively, there are, literally, millions of C++ professionals. More retire every year than the total of working Rust coders. That will change, eventually, if Rust catches on.