3 ms·
C++ may not be the best choice, but a language like Haskell would be worse for an aviation application for a number of reasons: 1) Memory on the hardware is ti
by john_b 12y ago
C++ may not be the best choice, but a language like Haskell would be worse for an aviation application for a number of reasons:
1) Memory on the hardware is tightly constrained and controlled, and you need some visibility into its usage at any given time. Even if it exposes you to null pointer errors and the like.
2) Along the same lines, throughput must be predictable and is tightly constrained. Anything happening at runtime that can't be predicted at compile time is, for a safety critical aviation application, a huge risk and is usually explicitly forbidden by the requirements.
3) Haskell is relatively new. C++ has stood the test of time and the DoD can be sure plenty of C++ programmers will still be around in 30+ years.
All of these are dealbreakers from the DoD's perspective. The technical risks associated with handling your own memory and not having provably safe code can be addressed with enough time and expense. Since the DoD is not short on money and operates on time scales of years or decades, this is acceptable. In a startup or academic environment, the balance of risks and resources is completely different. But believe it or not, the DoD and commercial aviation entities actually do look at the tradeoffs associated with the tools they choose and don't simply choose them out of inertia.
Source: I develop commercial jet engine software, where many of the same resource/risk tradeoffs exist.
- ihnorton 12y agoNo disagreement, but wanted to point out that groups like Galois have been using Haskell-embedded, compile-to-C DSLs in some interesting ways recently: http://smaccmpilot.org/images/dronecon-talk.pdf http://smaccmpilot.org/images/dronecon-talk.pdf This has the potential for nice compile-time guarantees without the runtime cost (and potentially at much lower cost than full formal verification) (also, fwiw, Haskell has been around since 1990, making it about 7 years younger than C++)