by eggy · 2y ago · 0 comments
Why wouldn't they use Ada/SPARK2014? They have a published language standard, verification tools, and 25 years of applied use for mission-critical, high-integrity software.
The current state of Rust is a moving target for such tools and design methods. Publish a formal language standard first.
You don't need a formal language standard to make Rust usable for safety-critical areas. You do need a formally specified language for the certification, but it doesn't have to be official because heck, you need much more than a mere formally specified language anyway as you've just said. An expanded version of Ferrocene would just fit the bill for example.
I think some people are obsessed about the "formal" specification or the language "standard" because they are misunderstanding their effects. They are absolutely nothing without additional supports. A "formal" specification in this context is not really mathematically formal (like, say, WebAssembly [1]); it merely means that a specification is written in clearly defined terms and logically decomposable statements. A language "standard" is useless if it isn't or can't be enforced, and it doesn't even require the (non-mathematical) formality (though most standard organizations would demand that). As for now, the Rust language specification is "formal" and "standard" enough to be useful for language users, while it remains useful for third-party implementors but they can still find some gaps here and there.
Did anyone specify wasm using something like Coq, Lean or Isabelle/HOL?
[1] https://webassembly.github.io/spec/core/valid/instructions.h...
But on this specific question, https://www.cl.cam.ac.uk/~caw77/papers/mechanising-and-verif... is the work I am aware of.
Would it be just easier to use something like OCaml? where it offers the memory safety and a mature language.
They tried but they were on the "nightly" branch of the standard and the compiler was on the "release" branch and then the compiler refused to compile the "nightly" standard because "nightly". /s