←back to thread

327 points AareyBaba | 1 comments | | HN request time: 0.328s | source
Show context
jandrewrogers ◴[] No.46183899[source]
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

replies(8): >>46184308 #>>46184351 #>>46184419 #>>46184493 #>>46184536 #>>46184570 #>>46185099 #>>46186673 #
Animats ◴[] No.46186673[source]
As 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?
replies(5): >>46186795 #>>46186825 #>>46187422 #>>46188382 #>>46188948 #
csmantle ◴[] No.46186795[source]
"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.
replies(1): >>46188283 #
1. vlovich123 ◴[] No.46188283[source]
This 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).