3 ms·
This is a pretty good summary. Not to pile on, because Rust is still in a fragile condition, but the point that Rust cannot, and never will be able to call, ty
by ncmncm 6y ago
This is a pretty good summary.
Not to pile on, because Rust is still in a fragile condition, but the point that Rust cannot, and never will be able to call, typical C++ libraries deserves a boost (no pun intended).
This matters because C++ has more facilities to encapsulate powerful semantics into libraries than any other language. People write libraries in C++ that cannot be written in other languages, routinely.
This makes it usually impractical to integrate Rust code into an existing modern C++ codebase, unless it implements a wholly independent subsystem. That matters because effectively all of the most demanding systems-level work, today, is conducted in C++, not C (old OS kernels and databases excepted).
The longevity problem also deserves attention. The normal, expected fate of any new language is to die. It practically takes a miracle to survive, and we have no way to predict miracles. So, we don't know if there will be anyone to maintain Rust code written today.
What will it take to survive? It comes down to numbers. Rust has an excellent adoption rate for a language at this stage. To survive, it might be enough were the rate to increase by two orders of magnitude.
You don't get that just by more and better publicity. It needs change. But the changes needed are, by experience, very, very unpopular among existing Rust users.
Rust will never displace C++ or C. C++ does things Rust can't. C will dwindle only as its user base retires, because C users actually like it for its failings: it makes them feel tough (or something). Rust is an overwhelmingly better language than Java or Go, and the world would be a better place if Rust were to displace them.
But neither of those has the specific problems that the borrow checker demands be solved. They have other, graver weaknesses. So, for Rust to displace them, its advocates will need to change their approach to appeal to users of those languages.
That will require at least a different build model that admits an order of magnitude faster builds, and a looser use of the borrow checker that generates less frustration. It might need accommodations to integrate in Go and Java projects, maybe including support for a JVM target, virtual call mechanism, and import of foreign Go and Java modules.
To get any of that, the project will need to excite people now in those environments with the prospect of easing their pain. Rust's advantage there is that their pain is great, and Rust could ease it.
- farresito 6y ago> Rust will never displace C++ or C. C++ does things Rust can't. Could you expand a little bit on that?
- steveklabnik 6y agoThere are some meta programming features C++ has that Rust doesn’t, like “template non-type parameters” and “template template parameters.” The former is called “const generics” in Rust, and is still in development, and the latter is “higher kinded types,” which Rust may or may not ever get.
- ncmncm 6y agoThe language enables a kind of calculus on types, that libraries routinely use to get better performance, better compile-time error detection, and to direct control to the best code path. C++20 just got "concepts", which make this capability vastly easier to use when creating a library, and enable some new capabilities along the same lines, while greatly improving compile-time error reports.
- ncmncm 6y agoI should add that asking about C++ is absolutely the wrong response if you are interested in saving Rust from scheduled oblivion. What it needs are active measures to increase its adoption rate by orders of magnitude. Hype on HN only goes a little way.
- LoveHateRust 6y ago>> Rust is an overwhelmingly better language than Java or Go 100% agreed >> and the world would be a better place if Rust were to displace them. Rust needs a standard lib like Go or ecosystem like Java. Production stuff needs to be stable. Especially Go gets this right. Rust with a standard lib like Go could rule the business apps world. But Rust doesn't even include an async runtime. It's not a problem, if Rust wants to stay in the niche where it is. Also, Rust advocates should not wonder why the adoption in the general purpose web space is far below its potential.