Live data from Hacker News

The C++ standard for the F-35 Fighter Jet [video]

youtube.com

41–50 of 451 posts

Re: The C++ standard for the F-35 Fighter Jet [video]

#41

Earlier quoted context omitted.

Depends on the company in my experience. I've seen some suppliers that basically just wire up the diagram in Matlab/simulink and hit Autocode. No humans actually touch the C that comes out. Honestly I think that's probably the correct way to write high reliability code.

You’re joking right? That autogenerated code is generally garbage and spaghetti code. It was probably the reason for Toyotas unintended acceleration glitch.

Modern autogenerated C code from Simulink is rather effective. It is neither garbage nor spaghetti, it is just... peculiar.

Re: The C++ standard for the F-35 Fighter Jet [video]

#42
The “90% ban” isn’t about hating C++ — it’s about guaranteeing determinism. In avionics, anything that can hide allocations, add unpredictable control flow, or complicate WCET analysis gets removed. Once you operate under those constraints, every language shrinks to a tiny, fully-auditable subset anyway.

Re: The C++ standard for the F-35 Fighter Jet [video]

#43

Earlier quoted context omitted.

What does RAII have to do with any of the above?

Not an expert but I’m pretty sure no exceptions means you can’t use significant parts of std algorithm or the std containers. And if you’re using pooling I think RAII gets significantly trickier to do.

https://en.cppreference.com/w/cpp/freestanding.html to see the parts you can use.

Re: The C++ standard for the F-35 Fighter Jet [video]

#47

I wonder how these compare to high frequency training standards. It seems like they'd have similar speed/reliability/predictability requirements in the critical paths.

JFS-CPP bans exceptions because you would lose control over the execution of the problem. The HFT crowds didn't like it because you'd add 10ns to a function call.

At least before we had zero-cost exceptions. These days, I suspect the HFT crowd is back to counting microseconds or milliseconds as trades are being done smarter, not faster.

Re: The C++ standard for the F-35 Fighter Jet [video]

#49
post #2

TL;DR - no exceptions - no recursion - no malloc()/free() in the inner-loop

Has anyone else here banned exceptions (for the most part) in less critical settings (like a web app)?

I feel like that's the way to go since you don't obscure control flow. I have also been considered adding assertions like TigerBeetle does

https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/TI...

Re: The C++ standard for the F-35 Fighter Jet [video]

#50

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

The 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.
Post reply on HN