4 ms·
For those interested, the F-35 (née Joint Strike Fighter) C++ coding standards can be found here, all 142 pages of it: https://www.stroustrup.com/JSF-AV-rules.
by jandrewrogers 11mo ago
For those interested, the F-35 (née Joint Strike Fighter) C++ coding standards can be found here, all 142 pages of it:
https://www.stroustrup.com/JSF-AV-rules.pdf https://www.stroustrup.com/JSF-AV-rules.pdf
- tgv 11mo agoFrom quickly glancing over a couple of pages, that looks sensible. Which makes me curious to see some exceptions to the "shall" rules. With a project of this size, that should give some idea about the usefulness of such standards.
- OhNoNotAgain_99 11mo ago[dead]
- extraduder_ire 11mo agoThe first time I came across this document, someone was using it as an example how the c++ you write for an Arduino Uno is still c++ despite missing so many features.
- msla 11mo agoInteresting they're using C++ as opposed to Ada.
- raffael_de 11mo agoInteresting font choice for the code snippets. I wonder if that's been chosen on a whim or if there is a reason for not going with mono space.
- throwaway2037 11mo agoThe font used for code samples looks nearly the same as "The C++ Programming Languages" (3rd edition / "Wave") by Bjarne Stroustrup. Looking back, yeah, I guess it was weird that he used italic variable width text for code samples, but uses tab stops to align the comments!
- shepherdjerred 11mo agoI wonder if they use static analysis to enforce these rules, or if developers are expected to just know all of this
- genewitch 11mo agoIn general, are these good recommendations for building software for embedded or lower-spec devices? I don't know how to do preprocessor macros anyhow, for instance - so as i am reading this i am like "yeah, i agree..." until the no stdio.h!
- GoblinSlayer 11mo agostdio.h is not what you would use in safe code.
- fragmede 11mo agodo they use f35io.h?
- whaleofatw2022 11mo agoAfair they use a lot of stuff related to the Green Hills toolchain.
- ecshafer 11mo agoDepends. You use vendor specific libraries for hard real time systems, or in house libraries, or roll your own functions.
- dmoy 11mo agoEmbedded more so than just lower-spec devices. Depends on the domain too. stdio.h is fine in some embedded contexts, and very very not fine in others
- Animats 11mo agoAs is common in hard real time code, there is no dynamic allocation during operation: allocation/deallocation from/to the free store (heap) shall not occur after initialization. This works fine when the problem is roughly constant, as it was in, say, 2005. But what do things look like in modern AI-guided drones?
- csmantle 11mo ago"AI" comes in various flavors. It could be a expert system, a decision forest, a CNN, a Transformer, etc. In most inference scenarios the model is fixed, the input/output shapes are pre-defined and actions are prescribed. So it's not that dynamic after all.
- vlovich123 11mo agoThis is also true of LLMs. I’m really not sure of OP’s point - AI (really all ML) generally is like the canonical “trivial to preallocate” problem. Where dynamic allocation starts to be really helpful is if you want to minimize your peak RAM usage for coexistence purposes (eg you have other processes running) or want to undersize your physical RAM requirements by leveraging temporal differences between different parts of code (ie components A and B never use memory simultaneously so either A or B can reuse the same RAM). It also does simplify some algorithms and also if you’re ever dealing with variable length inputs then it can help you not have to reason about maximums at design time (provided you just correctly handle an allocations failure).
- jandrewrogers 11mo agoWhy would the modern environment materially change this? The initialized resource allocation reflects the limitations of the hardware. That budget is what it is. I can't think of anything about "modern AI-guided drones" that would change the fundamental mechanics. Some systems support very elastic and dynamic workloads under fixed allocation constraints.
- Animats 11mo agoBasic flight control is a fixed-sized problem. More military aircraft systems now on what the environment and enemy are doing.