Live data from Hacker News

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

youtube.com

221–230 of 451 posts

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

#221

Earlier quoted context omitted.

there was a recent interview where andrew suggested if i understood correctly: the future path of zig is to make all compilations (successful or not) produce an executable. if theres something egregious like a syntax or type error, the produced artifact just prints the error and returns nonzero. for a "unused parameter", the compiler produces the artifact you expect, but returns nonzero (so it gets caught by CI for e…

Why would the compiler do that, instead of just printing the error at compile-time and exiting with a non-zero value? What is the benefit?

It is more a debug/development feature. You can try out some idea without fixing the whole code base.

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

#222

Earlier quoted context omitted.

Studies have looked at MISRA, I'm not aware of any for the JSF guidelines. For MISRA there's a mix, some of the rules seem to be effective (fewer defects in compliant software), some are the opposite (code which obeys these rules is more likely to have defects) and some were irrelevant. Notably this document is from 2005. So that's after C++ was standardized but before their second bite of that particular cherry and…

The "good" rules are like "don't write off the end of an array", and the bad ones are like "no early returns" or "variable names must not be longer than 6 characters". 95% of the "good" rules are basically just longer ways of saying "don't invoke undefined behavior".

Why is "no early returns" not a good rule?

I do early returns in code I write, but ONLY because everybody seems to do it. I prefer stuff to be in predictable places: variables at the top, return at the end. Simpler? Delphi/Pascal style.

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

#223

Earlier quoted context omitted.

Studies have looked at MISRA, I'm not aware of any for the JSF guidelines. For MISRA there's a mix, some of the rules seem to be effective (fewer defects in compliant software), some are the opposite (code which obeys these rules is more likely to have defects) and some were irrelevant. Notably this document is from 2005. So that's after C++ was standardized but before their second bite of that particular cherry and…

[flagged]

We've banned this account for continual guidelines breaches across multiple accounts.

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

#224

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

There have been countless articles claiming the demise and failure of the F35 but that is just one side of the story. There has been an argument started 50 years ago in the 1970's about how to build the best next generation fighter jets. One of these camps was called the "Fighter mafia"[0] figure headed by John Boyd. The main argument they bing was the only thing that matters for a jet fighter is how well it performs…

Yeah unfortunately no amount of manoeuvering is a substitute for a kill chain where a distributed web of sensors and relays and weapon carriers can result in an AAM being dispatched from any direction at lightspeed.

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

#225
post #109

https://web.archive.org/web/20111219004314/http://journal.th... (referenced, at least tangentially, in the video) is a piece from the engineering lead which does a great job discussing Why C++. The short summary is "they couldn't find enough people to write Ada, and even if they could, they also couldn't find enough Ada middleware and toolchain." I actually think Ada would be an easier sell today than it was back the…

Yeah I find myself wishing it would take off again.

I’m sure I’m idealizing it, but at least I’m not demonizing it like folks did back in the day.

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

#226
post #5

Do avionics in general subscribe to MISRA C/C++ or do they go even further with an additional (or different) approach?

Depends on the region. MISRA is widely adopted, and then there are the US MIL standards, ECSS for european aerospace stuff, do-178C for aviation..

/?hnlog awesome-safety-critical

From https://news.ycombinator.com/item?id=45562815 :

> awesome-safety-critical: https://awesome-safety-critical.readthedocs.io/en/latest/

From "Safe C++ proposal is not being continued" (2025) https://news.ycombinator.com/item?id=45237019 :

> Safe C++ draft: https://safecpp.org/draft.html

Also there are efforts to standardize safe Rust; rust-lang/fls, rustfoundation/safety-critical-rust-consortium

> How does what FLS enables compare to these [unfortunately discontinued] Safe C++ proposals?

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

#227

The same is true for the software that runs many satellites. Use of the STL is prohibited. The main issue is mission assurance. Using the stack or the heap means your variables aren't always at the same memory address. This can be bad if a particular memory cell has failed. If every variable has a fixed address, and one of those addresses goes bad, a patch can be loaded to move that address and the mission can contin…

> Using the stack or the heap means your variables aren't always at the same memory address

Where do you place the variables then? as global variables? and how do you detect if a memory cell has gone bad?

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

#228
post #102

Earlier quoted context omitted.

If you have memory to spare and are using hardware with an MMU, you can remap your logical address to a different page. Linux can do this, but only for user memory.

This assumes that the operating system can run. If the memory corruption impacts the OS, then it may be impossible to recover. As the systems (and software) have become more complex, keeping these Mission Assurance best practices becomes more important, but the modern generation of developers sometimes loses sight of this. A good example of what I'm talking about is a program that I was peripherally involved with abo…

>This assumes that the operating system can run.

You could have two copies of the OS mapped to different memory regions. The CPU would boot with the first copy, if it fails watchdog would trigger and the CPU could try to boot the second copy.

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

#229

Earlier quoted context omitted.

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?

How do you think these modern AI-guided drones use their AI? What part of the drone uses it?

Sensor input evaluation using subsystem produced confidence values?

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

#230
AUTOSAR's free pdf file Guidelines for the use of the C++14 language in critical and safety-related systems (defined as an update to MISRA C++ 2008) - http://www.autosar.org/fileadmin/standards/R18-10_R4.4.0_R1....

Note that both MISRA and AUTOSAR's guidelines have been combined into a single standard "MISRA C++ 2023" which has been updated for C++17.

Breaking Down the AUTOSAR C++14 Coding Guidelines - https://www.parasoft.com/blog/breaking-down-the-autosar-c14-...

Post reply on HN