Live data from Hacker News

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

youtube.com

131–140 of 451 posts

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

#131

Earlier quoted context omitted.

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

No I'm not joking at all. The Autocode feature generates code that has high fidelity to the model in simulink, and is immensely more reliable than a human. It is impossible for a simulink model to accidentally type `i > 0` when they meant `i >= 0`, for example. Any human who tells you they have not made this mistake is a liar. Unless there was a second uncommanded acceleration problem with Toyotas, my understanding i…

> It is impossible for a simulink model to accidentally type `i > 0` when they meant `i >= 0`

The Simulink Coder tool is a piece of software. It is designed and implemented by humans. It will have bugs.

Autogenerated code is different from human written code. It hits soft spots in the C/C++ compilers.

For example, autogenerated code can have really huge switch statements. You know, larger than the 15-bit branch offset the compiler implementer thought was big enough to handle any switch-statement any sane human would ever write? So now the switch jumps backwards instead when trying to get the the correct case-statement.

I'm not saying that Simulink Coder + a C/C++ compiler is bad. It might be better than the "manual coding" options available. But it's not 100% bug free either.

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

#132

Earlier quoted context omitted.

I've worked on a playout system for broadcast television. The software has to run for years at a time and not have any leaks, We need to send out one frame of television exactly on time, every time. It is "C++", but we also follow the same standards. Static memory allocation, no exceptions, no recursion. We don't use templates. We barely use inheritance. It's more like C with classes.

I worked on the same for many years; same deal - playout system for broadcast, years of uptime, never miss a frame. The C++ was atrocious. Home-made reference counting that was thread-dangerous, but depending on what kind of object the multi-multi-multi diamond inheritance would use, sometimes it would increment, sometimes it wouldn't. Entire objects made out of weird inheritance chains. Even the naming system was cr…

A multi-inhertiance system is certainly not something somebody who "was thinking in C" would ever come up with. This sounds more like a true C++ mess.

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

#134

Isn't the F35 program considered a failure? Or am I confusing it with some other program?

The F-35 was in development hell for a while for sure, but it’s far from a failure. See the recent deals where it’s been used as a political bargaining chip; it still ended up being a very desirable and capable platform from my understanding.

> See the recent deals where it’s been used as a political bargaining chip; it still ended up being a very desirable and capable platform from my understanding.

From a european perspective, I can tell you that the mood has shifted 180 degrees from "buy American fighters to solidify our ties with the US" to "can't rely on the US for anything which we'll need when the war comes".

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

#136

Earlier quoted context omitted.

This is basically video games prior to 2010

Relax the dynamic-memory restriction to "limit per-event memory allocation to the bump allocator" and it's still mostly true for many AAA/AAAA games I work on today.

Developers have gotten lazy. Im glad to here where you are they are at least still trying.

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

#137

Earlier quoted context omitted.

Relax the dynamic-memory restriction to "limit per-event memory allocation to the bump allocator" and it's still mostly true for many AAA/AAAA games I work on today.

Developers have gotten lazy. Im glad to here where you are they are at least still trying.

Nah I'm lazy, too.

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

#139

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

I wonder if they use static analysis to enforce these rules, or if developers are expected to just know all of this

"shall" recommendations are statically analyzed, "will" are not.

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

#140

a = a; // misra Actual code i have seen with my own eyes. (Not in F-35 code) Its a way to avoid removing an unused parameter from a method. Unused parameters are disallowed, but this is fine? I am sceptical that these coding standards make for good code!

An unused parameter should be commented out.
Post reply on HN