4 ms·
Rust has a high learning curve (borrowing, etc). Rust is a competitor to ADA, not C++. You can certainly ask developers to write things in rust instead, and eve
by jokoon 7y ago
Rust has a high learning curve (borrowing, etc). Rust is a competitor to ADA, not C++. You can certainly ask developers to write things in rust instead, and even progressively rewrite codebase in rust since it's compatible with C++, but a language is about adopters, and ease of learning for beginners and students.
- carlmr 7y agoCounterpoint, when you write C++ you need to think about borrowing without the compiler telling you when you're making a mistake. Rust in that sense is easier than C++.
- pjmlp 7y agoOnly if you are not using a recent version of clang or VC++. CppCon 2019: “Lifetime analysis for everyone” https://www.youtube.com/watch?v=d67kfSnhbpA https://www.youtube.com/watch?v=d67kfSnhbpA It is available to play on Godbolt.
- pjmlp 7y agoTo compete with Ada, Rust needs to offer something like SPARK, binary libraries, Ada like IDEs, real time specification, and most important certified compilers.
- unrealhoang 7y agoCounterpoint, Rust is actually easier to learn, and take way less time from inception to writing production-ready code.
- jokoon 7y agoeven the tutorial says that borrowing has a high learning curve
- xiphias2 7y agoThe biggest problem with C++ is that all real life production code is full of memory safety bugs. People usually just live with it. If you want to minimize memory safety issues, C++ becomes even harder than Rust.
- jokoon 7y agoSTL containers usually makes things easier. Usually the libraries deal with low level issues and are doing the hard work of increasing safety. Safety will always has a cost somewhere.
- thesuperbigfrog 7y agoRust and Ada are are only incidentally competitors: Ada was designed for programming safety-critical, military-grade embedded systems. Rust was designed as a memory-safe, concurrency-safe programming language, largely to overcome the shortcomings of C++. Each excels at what it was designed for, but the intended use cases are very different. Rust is not (currently) being used for aircraft flight control systems--Ada is. Ada is not (currently) being used for high-performance web browsers and servers--Rust is. While there are SOME similar design goals in terms of memory safety, concurrency safety, and error prevention, Rust was not designed to compete with Ada.
- V_Terranova_Jr 7y agoAda has been on the way out, at least in recent U.S. DoD flight system developments (and likely NASA as well) for a long time. I don't see this trend reverting any time soon. On the other hand, we can, and I hope will, move to much more rigorous approaches, such as the use of Rust, for flight software implementations. As you say, Rust was not specifically designed to compete with Ada, but accomplishes a number of similar goals and ultimately strives for correctness-by-construction, as does Ada. We will be better off in flight software using newer, safer languages employed by the software community writ large instead of trying to mandate niche languages.
- thesuperbigfrog 7y ago>> Ada has been on the way out, at least in recent U.S. DoD flight system developments (and likely NASA as well) for a long time. I don't see this trend reverting any time soon. Yeah, C++ has been working out great on the F-35. >> On the other hand, we can, and I hope will, move to much more rigorous approaches, such as the use of Rust, for flight software implementations. Competition is good and more choices for building avionics systems are welcome. I don't know of any DO-178C certified Rust implementations, but we need them. >> We will be better off in flight software using newer, safer languages employed by the software community writ large instead of trying to mandate niche languages. Part of the issue is that high-integrity, hard real-time embedded systems are their own niche in terms of requirements. Java and C# are widely-used programming languages with hundreds of millions of lines of code deployed in business-critical production environments and yet both are unsuitable for avionics environments. The more avionics niche-specific a programming language becomes the more likely it is to add complexity and features that those who program outside the niche will never use or care about.
- danbolt 7y agoInteresting. I feel like most C++ programmers I meet have a high level of enthusiasm for Rust, as it has C++'s high/low level blend and the safety helps prevent more footguns.
- xiphias2 7y agoI wanted to understand why Ada is not used in systems programming if it's so great, and found the answer: ,,Ada developers either use a garbage collector, or they avoid freeing memory entirely and design the whole application as a finite state machine (both of which are possible in Rust, too, but the point is you don’t have to). Of course, Ada has range-checked arithmetic, which Rust doesn’t have (it needs const generics first before that can be done in a library), so if you’re more worried about arithmetic errors than dangling pointers, then you might prefer Ada.'' For me not freeing memory sounds like a joke. It's the opposite of zero cost abstraction. Regarding GC there are lots of great languages already (for example modern Java).
- perl4ever 7y agoI didn't remember Ada having a garbage collector... https://stackoverflow.com/questions/1691059/why-doesnt-ada-have-a-garbage-collector https://stackoverflow.com/questions/1691059/why-doesnt-ada-h...