In Rust communities, it's often pitched as alternates to both, but closer to C.
I suppose it's all relative, but the comparison of rust to c++ seems external
In Rust communities, it's often pitched as alternates to both, but closer to C.
I suppose it's all relative, but the comparison of rust to c++ seems external
Obviously, C and Rust are both low-level languages (in terms of control and overhead), but there are quite a few of those.
However it can occupy some niches that C can but C++ does poorly because of zero cost abstractions, I think.
(Very handwavy)
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.
I also think users of C (not sure about Zig) are quite happy to automate things. Linus Torvalds is a big user of C. He wrote a little C-like compiler to check Linux kernel code called Sparse [1]. You seem to be trying to discuss maybe larger (but not very well articulated) subpopulations of "Users" than Apex Programmers like Linus. It is definitely easier to do this with C than giant languages like C++.
Why, the 1980s & 1990s were littered with maybe dozens of hacked C compilers doing "this or that" automation in a way you do not see for C++ (and will probably never see for Rust). In point of fact, C++ itself (C with classes) was an early example of such! The idea was to automate/codify the object-oriented style of Simula in C.
pjmlp's sibling & child comments are also some good color on the history/context of all this. { Of course, partly it all depends on what you meant by "language power" and "automate" - I am just going by what that seemed like. }
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.
Chapel, HPC language mostly sponsored by Intel and HPC
D programming language,
https://dlang.org/blog/2019/07/15/ownership-and-borrowing-in...
Ada/SPARK,
https://docs.adacore.com/spark2014-docs/html/ug/en/source/la...
Swift,
https://github.com/apple/swift/blob/main/docs/OwnershipManif...
ParaSail
Project Verona from Microsoft Research
https://www.microsoft.com/en-us/research/project/project-ver...
Project Snowflake from Microsoft Research
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-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-upda...
And GCC as well, although they are late to the party
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
Minor correction: Intel hasn't traditionally been a sponsor of Chapel (though we'd love to see that change). Chapel was pioneered at Cray Inc. and continues on even stronger at HPE after its acquisition of Cray.
-Brad
All the best.
Also, why even draw a stark contrast between "a language" and "its tooling"? As a dev, you get to use both.
What is even the line..? Almost every compiler for anything provides options. Does gcc -fsanitize=.. not count because it's not "standardized" or only because its not activated in "typical" deployments like Rust integer overflow checks?
C++ type system is impossible to fix while keeping backwards compatibility, so static analysis tooling is the only possible solution.
Though I believe the mozilla code it's replaced was all -very- C++.