Rust is one of the prime candidates for safety-critical systems.
And it looks like it is finally coming of age 🙂
After long and arduous work, Ferrous systems have released open source safety-critical qualified Rust compiler.
Check below announcement for more information:
But what is qualified tool
Those who are involved in safety critical work — and I claim no expertise here — know that one of the bigger ‘pains’ is to have qualified safety-critical tools to use.
For a ‘regular’ developer most of the tools are taken for granted like compilers, operating systems, frameworks, etc. Bugs and undefined behaviors1 are expected to exist and even used as ‘optimizations’2.
While determinism, quality, and reliability are desired, they often take a back seat to features, speed of delivery, and user experience.
But if you work on safety critical systems, it is vice-versa.
One of your biggest needs is a proof of deterministic behavior.
And there is a simple analogy.
If a house— or even more critically, a skyscraper — lacks a stable foundation, it’s only a matter of time before something catastrophic occurs.
You need and want proof (as much as feasible) that your foundations are stable. And you generally want that reputable company with reputable build process makes your foundations.
That is what qualification means in practice.
You want a tool that you can rely on where you will not be nasty surprised in a worst possible moment3.
And now Rust got its ‘reputable’ badge for use in safety critical systems.
Speed-up move to modern languages
There is also another reason why I’m Optimistic on Rust and new modern languages.
C and C++ are great languages for their uses, performance and low-level. C is a glorified assembly, and C++ gives you million ways to write bad or wrong code and only few good ones.
To use C and C++ in safety critical environment, you are severely restricted how you can apply those languages. Just check MISRA or AUTOSAR4 rules for writing automotive-grade quality code.
And even then you must use different set of tools (static and dynamic analyzers, linters, etc) just to make sure that you haven’t done offset +1 in memory access, or to implicitly do wrong typecast.
Long time ago I considered myself as a ‘quite good’ at C++, but then the more I learned, the less I knew 5 😀
If you need to put so many restrictions and constantly invent different ways how to stop people making almost invisible mistakes in a language, that means that you need to reconsider do you really need to step into that mine-field6.
And all of the hoops significantly slow the actual development time.
So lets see what future will bring7 🙂
- https://en.cppreference.com/w/c/language/behavior ↩︎
- https://alexpolt.github.io/undefined.html ↩︎
- https://www.motortrend.com/news/nhtsa-tesla-autopilot-investigation-shutoff-crash/ ↩︎
- https://www.autosar.org/news-events/detail?tx_news_pi1%5Baction%5D=detail&tx_news_pi1%5Bcontroller%5D=News&tx_news_pi1%5Bnews%5D=39&cHash=e4f521f7b674bdfd7c1fade308cf2ea8 ↩︎
- “Within C++, there is a much smaller and cleaner language struggling to get out” – Bjarne Stroustrup ↩︎
- Of course, C and C++ are highly used languages and have a great applications (just look in CERN or Linux kernel). But they should be not and are not applicable everywhere as the learning curve is high and space for errors even higher ↩︎
- Greetings to team Trust at VCC doing great work for production grade Rust in actual car 🙂 ↩︎