Live data from Hacker News

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

youtube.com

271–280 of 451 posts

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

#271

Earlier quoted context omitted.

> 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 continue. This seems like a rather manual way to go about things for which an automated solution can be devised. Such as create special ECC memory where you also account for entire cell failure with Reed-Solomon coding or s…

It is more than that. This is what make remote debugging possible. It is impossible to do interactive remote debugging over a ultra low bandwidth link. If everything have static address and deterministic static, you can have a exact copy on ground and debug there.

Interactive debugging is apparently possible and was reportedly done on Deep Space One mission. One of developers involved frequents HN I believe.

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

#272
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…

I've always strongly disliked this argument of not enough X programmers. If the DoD enforces the requirement for Ada, Universities, job training centers, and companies will follow. People can learn new languages. And the F35 and America's combat readiness would be in a better place today with Ada instead of C++.

I agree. First of all I don't think Ada is a difficult language to learn. Hire C++ programmers and let them learn Ada.

Secondly, when companies say "we can't hire enough X" what they really mean is "X are too expensive". They probably have some strict salary bands and nobody had the power to change them.

In other words there are plenty of expensive good Ada and C++ programmers, but there are only cheap crap C++ programmers.

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

#273
post #202

Earlier quoted context omitted.

The "standard" (typically defined in projects I'm familiar with, and as of C23, an actual standard) is "unreachable": https://en.cppreference.com/w/c/program/unreachable.html

That is not the same thing at all. Unreachable means that entire branch cannot be taken and the compiler is free to inject optimizations assuming that’s the case. It doesn’t need to crash if the violation isn’t met - indeed it probably won’t. It’s the equivalent of having something like x->foo(); if (x == null) { Return error…; } This literally caused a security vulnerability in the Linux kernel because it’s UB to de…

For many types of projects and approaches, avoiding UB is necessary but not at all sufficient. It's perfectly possible to have critical bugs that can cause loss of health or life or loss of millions of dollars, without any undefined behavior being involved.

Funnily enough, Rust's pattern matching, an innovation among systems languages without GCs (a small space inhabited by languages like C, C++ and Ada), may matter more regarding correctness and reliability than its famous borrow checker.

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

#274

Earlier quoted context omitted.

> 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?

your programs have a data segment. its not the heap nor the stack... and it can be (depending on loader/linker) a source of reliable object->address mappings as its not dynamically populated.

That sounds like your answer is: "Yes, global variables".

That may be a perfectly good solution in many embedded environments, but in most other context's global variables are considered bad design or very limiting and impractical.

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

#275

The C++ standard for the F-35 fighter jet prohibits ninety percent of C++ features because what they are actually after is C with destructors. I was just thinking about how to write C in a modern way today and discovered GLib has an enormous about of useful C++ convieniences in plain C. Reading through the JSF++ coding standards I see they ban exceptions, ban the standard template library, ban multiple inheritance, b…

I'm a big fan of the GLib/old ObjC approach when it comes to UI elements and backwards compatibility with C but I can't imagine a situation where it would be appropriate on the kind of embedded we're discussing here to dynamically create and destroy objects - whether through malloc or oop. Maybe on the HUD but even there I'd favor other approaches if it were my soldiers that I want to return home behind that HUD.

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

#276
post #212
post #204

Earlier quoted context omitted.

C++ keeps getting bigger and bigger :D Thanks for sharing

This is actually C and C++ has not done something similar AFAIK.

Fortunately the major compiler vendors all have. Routing around the standards committee is getting more and more common.

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

#277

Earlier quoted context omitted.

I've always strongly disliked this argument of not enough X programmers. If the DoD enforces the requirement for Ada, Universities, job training centers, and companies will follow. People can learn new languages. And the F35 and America's combat readiness would be in a better place today with Ada instead of C++.

I agree. First of all I don't think Ada is a difficult language to learn. Hire C++ programmers and let them learn Ada. Secondly, when companies say "we can't hire enough X" what they really mean is "X are too expensive". They probably have some strict salary bands and nobody had the power to change them. In other words there are plenty of expensive good Ada and C++ programmers, but there are only cheap crap C++ progr…

As I wrote to someone else:

Why require that companies use a specific programming language instead of requiring that the end product is good? > And the F35 and America's combat readiness would be in a better place today with Ada instead of C++.

What is the evidence for this? Companies selling Ada products would almost certainly agree, since they have a horse in the race. Ada does not automatically lead to better, more robust, safer or fully correct software.

Your line of argument is dangerous and dishonest, as real life regrettably shows.[0]

[0]: https://en.wikipedia.org/wiki/Ariane_flight_V88

> The failure has become known as one of the most infamous and expensive software bugs in history.[2] The failure resulted in a loss of more than US$370 million.[3]

> The launch failure brought the high risks associated with complex computing systems to the attention of the general public, politicians, and executives, resulting in increased support for research on ensuring the reliability of safety-critical systems. The subsequent automated analysis of the Ariane code (written in Ada) was the first example of large-scale static code analysis by abstract interpretation.[9]

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

#278
post #273

Earlier quoted context omitted.

That is not the same thing at all. Unreachable means that entire branch cannot be taken and the compiler is free to inject optimizations assuming that’s the case. It doesn’t need to crash if the violation isn’t met - indeed it probably won’t. It’s the equivalent of having something like x->foo(); if (x == null) { Return error…; } This literally caused a security vulnerability in the Linux kernel because it’s UB to de…

For many types of projects and approaches, avoiding UB is necessary but not at all sufficient. It's perfectly possible to have critical bugs that can cause loss of health or life or loss of millions of dollars, without any undefined behavior being involved. Funnily enough, Rust's pattern matching, an innovation among systems languages without GCs (a small space inhabited by languages like C, C++ and Ada), may matter…

Didn't PASCAL have variant record types with a kind of primitive pattern matching already?

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

#280
post #261
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…

Given that there are still 7 vendors selling Ada compilers I always found that argument a bit disingenuous. https://www.adacore.com/ https://www.ghs.com/products/ada_optimizing_compilers.html https://www.ptc.com/en/products/developer-tools/apexada https://www.ddci.com/solutions/products/ddci-developer-suite ... http://www.irvine.com/tech.html http://www.ocsystems.com/w/index.php/OCS:PowerAda http://www.rrsoftware.com…

Another factor for Ada not being more popular is probably: https://en.wikipedia.org/wiki/Ariane_flight_V88

> The failure has become known as one of the most infamous and expensive software bugs in history.[2] The failure resulted in a loss of more than US$370 million.[3]

> The launch failure brought the high risks associated with complex computing systems to the attention of the general public, politicians, and executives, resulting in increased support for research on ensuring the reliability of safety-critical systems. The subsequent automated analysis of the Ariane code (written in Ada) was the first example of large-scale static code analysis by abstract interpretation.[9]

Post reply on HN