However, the rust/LLVM compiler pipeline is nowhere near mature enough for use in high-criticality environments.
However, the rust/LLVM compiler pipeline is nowhere near mature enough for use in high-criticality environments.
I love Rust, but I wouldn't want it to fly a plane I'm on. For instance, here's a bug in LLVM that Rust developers happened to discover - before they disabled their use of the buggy features, Rust/LLVM was producing _numerically incorrect_ code. https://github.com/rust-lang/rust/issues/54878#issuecomment-...
Age doesn't automatically protect you from bugs.
I don't know about Rust, but LLVM isn't mature? Nearly ever program running in the Apple ecosystem was compiled using LLVM. Swift is compiled using LLVM. Since Xcode 4.2, Clang is the default compiler. So iOS and macOS apps are built with LLVM. I'd also wager a guess that Apple uses Clang to compile key system code (Darwin, macOS, and iOS, etc) as well.
It is becoming more mature... But the argument about how to handle an empty infinite loop has been going on since 2015.
Because seriously these people need to be stopped.
Anyway, just test with ubsan and you'll be good.
[0] https://www.cs.utah.edu/~regehr/papers/undef-pldi17.pdf
[1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
* Some is inherited from LLVM, some is bugs, some is dumb corner cases like using kernel syscalls to overwrite the program's own memory with random bits.
(Unlike code running for avionics for example)
There was actually an incident posted on HN a while ago where IIRC an ipad did a software update or similar at a critical moment, and caused complications bad enough to get an incident report published on some aviation agency's website.
In a critical situation this is impossible, though.
I have heard about just flying with no G-load for a while and getting some basic instruments working. But I dont think you will get full nav functionality back.
Behold, LLVM and GCC both miscompile the same numerical code involving mildly tricky aliasing constraints. https://github.com/rust-lang/rust/issues/54878#issuecomment-...
I think I'd prefer that safety-critical code be written in languages that don't allow pointer arithmetic except in scenarios that can be proved via static analysis not to introduce multiple memory aliases. Expecting program writers and compiler authors to get these sorts of things right in C/C++ is just unreasonable.
I'd argue that you would probably never find a bug such as that in a certified compiler, not because of the certification, but because far, far fewer eyes look at its output. I have worked in safety critical software and used a certified compiler. It had enough bugs that I personally found four in my first year.