| > It matters fundamentally. "Works well" for research projects or limited AWS components is not equivalent to DO-178C Level A certification where mathematical proof is required As said in a sibling comment, certification to Rust starts to appear. Rust is young and its usage in regulated industries is just barely beginning. Ada and SPARK are old and mature. It's not a fair comparison - but that doesn't mean Rust couldn't get there. > > Few of the tools can verify unsafe code is free of UB
>
> With heavy annotation burden, for specific patterns > > some of the tools do support interior mutability (with extra annotations I believe)
>
> Exactly - manual annotation burden. SPARK does not support the equivalent (shared mutable pointers) at all. Rust verifies do with a heavy annotation burden. What's better? > Trait resolution determines which code executes (monomorphization). Lifetimes affect drop order and program semantics. These aren't erased - they're compiled into the code being verified. SPARK's type system is verifiable; Rust's requires the verifier to trust the compiler's type checker. Has the Ada compiler formally verified? No. So you're trusting the Ada type checker just as well. The Ada specification was, if I understand correctly, formally defined. But there are efforts to do that to Rust as well (MiniRust, a-mir-formality, and in the past RustBelt). > The macro logic is unverified Rust code executing at compile time. A bug in the macro generates incorrect code that may pass verification. SPARK has no equivalent escape hatch. And if you have a script that generates some boilerplate code into your Ada project, is the script logic verified? The outputted code is, and that's what important. Even with full formal verification, proving that the program fulfills its goals, you don't need to verify helpers like this - only the code they generate. If it works, then even if the script is buggy, who cares. > So they're doing what SPARK does automatically - proving absence of runtime errors Exactly - that's the point, to prove free of runtime errors. I'm not sure what you mean by "SPARK guarantees this for the language; Rust tools must verify it per codebase" - does SPARK not need to verify separate codebases separately? Does it somehow work magically for all of your codebases at once? It's clear at this point that neither of us will get convinced, and I think I said everything I had about this already. Have fun developing with Ada! |
https://github.com/Speykious/cve-rs
https://github.com/lcnr/solver-woes/issues