5 ms·
Yes, I also had the impression Rust is a C replacement.
by k__ 5y ago
Yes, I also had the impression Rust is a C replacement.
- mst 5y agoI sort of look at it as aiming at the spot where you could write the code in C with a sprinkle of C++ features and whether to add that sprinkle or do things like hand-rolling a vtable system where you need one is a decision that will vary depending on circumstances. Though I believe the mozilla code it's replaced was all -very- C++.
- eximius 5y agoFrom a programming language design space, it's much more like C++. However it can occupy some niches that C can but C++ does poorly because of zero cost abstractions, I think. (Very handwavy)
- ncmncm 5y agoThere are no niches where Rust can do better than C++. In many places Rust can, uniquely, match C++.
- jibalt 5y agoThis is of course false.
- tialaramex 5y agoDe gustibus non est disputandum, and thus at such a high level of abstraction you are at best trolling.
- ncmncm 5y agoThe first person to mention trolling is invariably the troll.
- ncmncm 5y agoRust's purpose, its whole reason to exist, is to displace C. Rust will unavoidably fail in that, because anybody still using C is not willing to learn anything else: anybody willing to move on from C already did, long ago. Rust is already approaching C++ in complexity, surpassing it in some places; and also in expressive power, but not surpassing it anywhere yet. If Rust does not end up fizzling (which is still very possible!), Rust programmers will generally be drawn from the same population as C++ programmers. They will be people who want and can use a powerful language to make themselves more productive and able to manage bigger projects, without need to worry that they are taking a performance penalty, or losing control of details that matter. Users of Zig, like of Nim and C, will be those uncomfortable with language power, disinclined to automate. Their attention is not on software and what they can build of it, but on problems where a thin veneer of software can add something useful. When there is not much for the software to do, you don't need much power to get it doing that.
- deleted 5y ago[deleted]
- pjmlp 5y agoEven if the only success story for Rust would be mainstream adoption of lifetime checkers across languages to some extent, that would already be a victory as it managed to change the baseline of language design across the industry. A subject that now has become even regular presence at C++ conferences and considered a must have in static analysers roadmap by all major vendors. Rust might fizzle out in a decade, and still leave such a mark in the industry.
- ncmncm 5y agoI have not heard of a lifetime checker in any other language, except maybe Midori.
- pjmlp 5y agoSo here is a sample, Chapel, HPC language mostly sponsored by Intel and HPC https://chapel-lang.org/ https://chapel-lang.org/ D programming language, https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in-d/ https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in... Ada/SPARK, https://docs.adacore.com/spark2014-docs/html/ug/en/source/language_restrictions.html#memory-ownership-policy https://docs.adacore.com/spark2014-docs/html/ug/en/source/la... Swift, https://github.com/apple/swift/blob/main/docs/OwnershipManifesto.md https://github.com/apple/swift/blob/main/docs/OwnershipManif... ParaSail http://www.parasail-lang.org/ http://www.parasail-lang.org/ Project Verona from Microsoft Research https://www.microsoft.com/en-us/research/project/project-verona/ https://www.microsoft.com/en-us/research/project/project-ver... Project Snowflake from Microsoft Research https://www.microsoft.com/en-us/research/publication/project-snowflake-non-blocking-safe-manual-memory-management-net/ https://www.microsoft.com/en-us/research/publication/project... And finally your favourite C++ "Implementing the C++ Core Guidelines’ Lifetime Safety Profile in Clang" https://llvm.org/devmtg/2019-04/slides/TechTalk-Horvath-Implementing_the_C++_Core_Guidelines_Lifetime.pdf https://llvm.org/devmtg/2019-04/slides/TechTalk-Horvath-Impl... Also the "Clang Static Analyzer - A Tryst with Smart Pointers" talk at 2021 LLVM Developers Meeting. For the Visual C++ part of the story https://devblogs.microsoft.com/cppblog/lifetime-profile-update-in-visual-studio-2019-preview-2/ https://devblogs.microsoft.com/cppblog/lifetime-profile-upda... And GCC as well, although they are late to the party https://gcc.gnu.org/wiki/DavidMalcolm/StaticAnalyzer https://gcc.gnu.org/wiki/DavidMalcolm/StaticAnalyzer Finally a couple of CppCon 2021 talks that touch on the subject in various ways, Type-and-resource safety in modern C++ Code Analysis++ Static Analysis and Program Safety in C++: Making it Real Finding Bugs Using Path-Sensitive Static Analysis