3 ms·
You casually mention C++ along with C but you can't really put them in the same bucket. C++ is terribly, mindbogglingly, utterly, complex, its main selling poin
by sharikous 5y ago
You casually mention C++ along with C but you can't really put them in the same bucket. C++ is terribly, mindbogglingly, utterly, complex, its main selling points being zero-cost abstractions and compatibility with C. Perhaps we have different experiences but I don't see Rust as complex to learn with respect to C++. In C++, coming from C, the syntax is deceptively similar but you have to track in your head where the memory is, and seemingly simple operators like "=" or "()" can mean a whole lot of different stuff. Not to mention the craziness of the more advanced features.
Rust is first a system programming language with zero-cost abstractions with the least possible pain, then it is a safe language, way safer than C++.
In any case I am following the community and I have a hard time finding people saying C++ is nice for them. There are few people who have been coding C++ for 20+ years and "love" it but they are far and between. Almost nobody tried both Rust and C++ and continued using C++ for new projects.
So I predict Rust won't replace C, they have different use cases, but it will make a dent in C++.
- pjmlp 5y agoThere is one caveat though, as long as Rust depends on LLVM, it won't fully make it.
- DerArzt 5y ago> as long as Rust depends on LLVM, it won't fully make it Why won't it? I haven't really used rust or LLVM before, so I am genuinely curious.
- pjmlp 5y agoLLVM is written in C++, so any change of Rust compiler that requires changes in the backend requires C++ knowledge, and naturally dependency on a C++ compiler to get the rust compiler binary.
- DerArzt 5y agoAh, I see what you mean now. The follow up question I have is: so what? Python is an extremely popular language that is built on C/C++. Unless you are a contributor to the rust spec, why would it matter what language the compiler is written in? The way I take it, the rust compiler team can either spend their time trying to get to being self hosted, or they can spend their time making improvements to the language.
- pjmlp 5y agoBecause one of the Rust goals is to improve the security landscape and reduce the use of C and C++. It is a bit hard to achieve such goal if improving Rust requires to some extent, to keep writing C++. Naturally some day the compiler might be fully bootstraped, however that implies throwing away the work being done by legions of C++ devs on LLVM (same applies to be front ends being written to plug Rust into GCC).
- DerArzt 5y agoYeah, it would be nice if the compiler team was dog-fooding, but we need to be pragmatic don't we?