5 ms·
> - Easy to implement the language specification. All features should be easy to understand. I'm not sure this is at all applicable to rust. Perhaps once there
by falcolas 7y ago
> - Easy to implement the language specification. All features should be easy to understand.
I'm not sure this is at all applicable to rust. Perhaps once there are more than the one, quickly mutating, implementation, we can say that it's easy to implement the specification.
> - Reliability. The language should aid the design and development of reliable programs.
This one feels a touch questionable, given the built-in "succeed or die" macros that simplify code at the cost of reliability. There's also the unsafe keyword, and how the impact of an unsafe operation in one section of code (say, an imported library) can have negative impacts on unrelated sections of code otherwise deemed safe.
> - No unnecessary complexity. Semantic structure should be consistent and minimize the number of concepts.
Borrow checker aside, there is a ton of complexity in Rust (traits, multiple flavors of arrays, multiple flavors of boxed values).
> - Machine independence. The language shall not be bound to any hardware or OS details.
Rust relies on the LLVM project to provide this, and relies on the contributors to the LLVM project to target different architectures.
- swsieber 7y ago> given the built-in "succeed or die" macros that simplify code at the cost of reliability Most of those are linted for, so you can use them to speed development but still be aware that they shouldn't be there in production code.
- falcolas 7y agoThese points are around language design and implementation; linting is an additional set of tools outside the scope of the language itself. Whether it should or shouldn't be in production, following Ada's rules it wouldn't be allowed in the code in the first place.
- swsieber 7y agoI'd argue that lints are part of the language - they are run as part of the compiler, and block code from compiling, like the "must use" lint. That said, they are configurable, so I see your point - they are more permissive than what Ada allows OTOH, I believe you can turn lint warnings into hard errors for only production, allow for fast development but programmatically disallowing them from reaching production. But again, thats configurable.
- vardump 7y ago> ...unsafe operation in one section of code (say, an imported library) can have negative impacts on unrelated sections of code otherwise deemed safe. Yeah. Just like every line in C/C++ code can have negative impacts on unrelated sections. While true, that talking point feels somewhat unfair or even in bad faith. Rust requires "unsafe" escape hatch to be able be a low level systems language. Or gasp, to call libraries using C ABI. I write a lot of low level code in C/C++ (firmware, kernel drivers, low level services) and I think a C ABI compatible "runtimeless" safe language, like Rust, dramatically improve security, safety and even ultimately provide faster time-to-market.
- otabdeveloper2 7y ago> C/C++ No such thing.
- falcolas 7y agoThis comparison is against Ada's language criteria, not C/C++. You're well above 100% right with your points, if we weren't looking at the language criteria put forth by Ada. EDIT: It's worth nothing that Ada is also a system and embedded programming language.
- Jweb_Guru 7y agoAda has unsafe code as well and messing it up causes exactly the same thing as it does in Rust or C++, so I'm not sure what your point is.
- kelnos 7y ago> given the built-in "succeed or die" macros that simplify code at the cost of reliability. I would consider a program that dies early to be more reliable (but less robust) than one that just soldiers on, probably doing wrong (and possibly dangerous) things. Regardless, it is the programmers choice whether to call panic!() or to try to handle an error gracefully and continue.
- kragen 7y agoIt depends on the situation. Ariane 5 was destroyed because its inertial reference system (written in Ada) died early instead of soldiering on, and as it turns out, it would have been fine if it had soldiered on. Really, there's a certain amount of software, like the Ariane 5 SRI, for which the only acceptable outcome is not to have the error in the first place — there's no acceptable way to handle it once it happens. That software is very expensive to write, so you want to keep it to a minimum in the overall system, but sometimes you cannot avoid having some of it.