189 points · by zeristor · 5y ago · 37 comments
The framework itself is portable allowing for code sharing across multiple missions and hardware setups. According to the devs, in the space industry, software is so mission specific and intertwined that it's rarely reused. FPrime's "modules" create hard barriers between sections of the program, something I have mixed feelings about. Finally the "module" system allows for a very easy to use concurrency model, which I think is one of the strengths of the framework. (Though, take these words with a grain of salt as I was and still am wildly underqualified in the domain of embedded systems)
F' is actually quite older than all those systems. Several generations of scientists and engineers have worked on it and the code's current form is a result of countless iterations on generations of software. One interesting tidbit I caught recently was how programs generated using cFS acted up in the magnetic field on Mars due to the bit patters of the instructions in the final compiled executable. F' fixed that.
It is akin to the python ecosystem, where there is A LOT of good software and packages out there, but there is also A LOT of garbage out there.
The community is nice and supportive, and the framework has really matured recently, with ROS1 being "complete" and ROS2 getting off the ground with a lot of mature features like DDS
I.e. the Rust this, Rust that spam is a little naive to the task at hand, even though it would be a step up from C
I know I've seen an older document that specifically prohibited use of malloc that the risk was too great. Is that still the case?
I'm not related to this project or aerospace, so I can't divine more knowledge than anyone else, although I have seen many coding standards that forbid malloc after some critical time (e.g. no dynamic memory allocation after the plane is off the ground)
Parts of the STL were formally verified. cprover (with satabs and cbmc) can handle C, C++ or Java. F' uses autogenerated classes, which helps a lot avoiding mistakes.
Advocacy should always be tempered with a bit of hard reality check, otherwise one just ends up scaring possible adopters away.
Rust almost certainly could do the job now but stakes are so high no one would take that risk when its proven that C can do it and with enough auditing and conservatism, it can be done pretty safely.
Now, these sorts of systems should actually be _easier_, in the long-term, to build in Rust, since the type system can enable a class of proof which simply was not historically possible, but for the time being, the tooling doesn't exist yet.
I think the "safety" of "familiarity" vs pushing the envelope of what we can do technically are different things. We used to build brand new computers and operating systems from scratch specifically for these types of things.
The risks are indeed high for managerial staff. I worked at a large quasi-government place. "you won't ever get fired for using Microsoft, Oracle, etc" was a tagline we heard often in non-critical systems, so I imagine there would need to be some major technical reason to switch.
Now drones on the other hand... https://en.wikipedia.org/wiki/Iran%E2%80%93U.S._RQ-170_incid...
people were writing mission-critical C++ when C++ was new / only a few years old; with this in mind, rust is probably good to go with sufficient application/system testing
that said, since C++ & associated tooling exists, there is more of an opportunity cost since, in the context of today, there are more alternatives that could be considered
There should be an industry push for certified Rust tooling, it would save the aerospace and auto industry billions. Or you could use the unsexy but also very good ADA 2012, which is already certified.
a) probably the least important class of bugs for this sort of thing
b) adequately solved with the existing C++ language features anyways.
So what would be the point of rewriting in Rust?
(Assume the people writing it aready have the C++ knowledge and tooling ready.)
Mutating aliased objects is, of course, usually the desired outcome and not a bug. It becomes a bug when your program's concurrency logic is not thought through, and there are no easy solutions here.