Coming from C/C++ background, I am aware of coding standards that apply for Safety Critical applications (like the classic trio Medical-Automotive-Aerospace) in the context of embedded systems , such as MISRA, SEI CERT, Barr etc.
Skipping the question if it should or if it is applicable as a language, I want to create Python applications for embedded systems that -even vaguely- follow some safety standard, but couldn't find any by searching, except from generic Python coding standards (like PEP8)
Is there a Python coding guideline that specificallly apply to safety-critical systems ?
Top layer safety standards for "functional safety" like IEC 61508 (industrial), ISO 26262 (automotive) or DO-178 (aerospace) etc come with a software part (for example IEC 61508-3), where they list a number of suitable programming languages. These are exclusively old languages proven in use for a long time, where all flaws and poorly-defined behavior is regarded as well-known and execution can be regarded as predictable.
In practice, for the highest safety levels it means that you are pretty much restricted to C with safe subset (MISRA C) or Ada with safe subset (SPARK). A bunch of other old languages like Modula-2, Pascal and Fortran are also mentioned, but the tool support for these in the context of modern safety MCUs is non-existent. As is support for Python for such MCUs.
Languages like Python and C++ are not even mentioned for the lowest safety levels, so between the lines they are dismissed as entirely unsuitable. Even less so than pure assembler, which is actually mentioned as something that may used for the lower safety levels.
From my experience in the railway and automotive industries, there is no closed list of programming languages. The thing is that the programming language must have specific properties and the tool used for development must be qualified.
As an example I can refer to railway EN-50716. Table A.15 "Suitable Programming Languages" only lists the recommended and highly recommended programming language properties (such as "supports commenting", "supports testing", or "supports static analysis"). The table is supplemented by Section D.54 of Appendix D, which covers these topics in more detail, but there is still no closed list of possible programming languages. This simply means that the list is open and future-proof - if any language meets the specific criteria, then it can be used.
I believe this is also true for automotive ISO-26262 (as far as I can remember), but I have no experience in other sectors.
This has serious practical consequences - since the list is open, you are not limited to "old", well-known languages like C, C++ or Ada, but for some time now there is also the possibility to use Rust in a safety-critical application - qualified rust. In the end, you have to provide an evidence to the assessor that your choice makes sense (in the context of the used standard).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With