Live data from Hacker News

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

youtube.com

331–340 of 451 posts

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

#331

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. Your mention of STL makes it sound like you're talking about C++. But I don't know of any C++ compiler that lets you completely avoid use of the stack, even if you disable the usual suspects (RTTI and exceptions). Sure, you'd have to avoid local variables, defined within a function's body (or at block scope), but that's nowhe…

Your points are correct, but recursion is banned anyway in safety critical applications. The main issue is determinism. The fact you have to use the stack for call stacks is correct OP seems misinformed.

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

#332
post #328

A very jovial discussion of systems that have killed millions of innocent people. Maybe you could do the same treatment of Nazi gas chambers or something for the next video?

Weird link to gas chambers.. Do you think 'genocides' will go down if we bring first world militaries to third world standards?

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

#334
post #288

Earlier quoted context omitted.

Actually these kinds of projects are chronically over budget and the US military is notorious for wasting money. Using C++ vs wishing an Ada ecosystem into existence may have been one of the few successful cost saving measures. Keep in mind that these are not normal programmers. They need to have a security clearance and fulfill specific requirements.

They need to have very strict security clearance requirements and maintain them throughout the life of the project or their tenure. People don’t realize this isn’t some little embedded app you throw on an ESP32. You’ll be interviewed, your family, your neighbors, your school teachers, your past bosses, your cousin once removed, your sheriff, your past lovers, and even your old childhood friends. Your life goes under…

I went through the TS positive vetting process (for signals intelligence, not writing software for fighter jets, but the process is presumably the same).

If I were back on the job market, I’d be demanding a big premium to go through it again. It’s very intrusive, puts significant limitations on where you can go, and adds significant job uncertainty (since your job is now tied to your clearance).

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

#335
post #280
post #261

Earlier quoted context omitted.

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 execu…

The failure of Ariane was not specific to Ada.

It is just an example that it is possible to write garbage programs in any programming language, regardless if it is Rust or any other supposedly safer programming language.

A program written in C, but compiled with the option to trap on overflow errors would have behaved identically to the Ada program of Ariane.

A program where exceptions are ignored would have continued to run, but most likely the rocket would have crashed anyway a little later due to nonsense program decisions and the cause would have been more difficult to discover.

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

#336
post #289

Earlier quoted context omitted.

> Many EU countries are falling over each-other to buy it They are not buying it for its capabilities though, but to please their US ally/bully which would have retaliated economically otherwise. See the very recent Swiss case were theirs pilots had chosen another aircraft (the french Rafale), only to be disavowed by their politics later on.

Maybe the EU shouldn’t have transformed themselves into US vassals then. Nobody respects weakness, not even an ally. Ironically showing a spine and decoupling from the US on some topics would have hurt more short term, but would have been healthier in the long term.

>Maybe the EU shouldn’t have transformed themselves into US vassals then.

I share the same opinion. If you're (on paper) the biggest economic block in the world, but you can be so easily bullied, then you've already failed >20 years ago.

But I don't think it was bullying, but the other way around. EU countries were just buying favoritism for US military protection, because it was still way cheaper than ripping the bandaid and building its own domestic military industry of similar power and scale.

Most defense spending uses the same motivation. You're not seeking to buying the best or cheapest hardware, you seek to buy powerful friends.

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

#337
post #295

Earlier quoted context omitted.

I like rust matching for this reason: You need to cover all branches. In fact, not using a default (the else clause equivalent) is ideal if you can explicitly cover all cases, because then if the possibilities expand (say a new value in an enum) you’ll be annoyed by the compiler to cover the new case, which might otherwise slip by.

And I like using enums in C ;-) The compiler tells you to cover all branches. https://godbolt.org/z/bY1P9Kx7n

The compiler also tells you that even if you cover all enum members, you still need a `default` to cover everything, because C enums allow non-member values.

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

#338

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++.

No they won't. DoD is small compared to the rest of the software market. You get better quality and lower cost with COTS than with custom solutions, unless you spend a crap ton . The labor market for software's no different. Everyone likes to crap on C++ because it's (a) popular and (b) tries to make everyone happy with a ton of different paradigms built-in. But you can program nearly any system with it more scalably…

In my experience people criticize C++ for its safety problems. Safety is more important in certain areas than in others. I’m not convinced that you get better quality with C++ than with Ada

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

#339

Earlier quoted context omitted.

> Using the stack or the heap means your variables aren't always at the same memory address. Your mention of STL makes it sound like you're talking about C++. But I don't know of any C++ compiler that lets you completely avoid use of the stack, even if you disable the usual suspects (RTTI and exceptions). Sure, you'd have to avoid local variables, defined within a function's body (or at block scope), but that's nowhe…

Your points are correct, but recursion is banned anyway in safety critical applications. The main issue is determinism. The fact you have to use the stack for call stacks is correct OP seems misinformed.

You have to use the stack for procedure calls on x86/x86-64 CPUs, where the hardware enforces this.

In most other surviving CPU ISAs the return address is saved in a register and it is easy to arrange in a compiler to use only procedure arguments that are passed in registers, the only price being paid for this being a reasonable upper limit for the number of parameters of a function, e.g. 12 or 24, depending on the number of general-purpose registers (e.g. 16 or 32). For the very rare case when a programmer would want more parameters, some of them should be grouped into a structure.

With this convention, which normally should not be a problem, there is no need for a call stack. There can be software managed stacks, which can be used even for implementing recursion, when that is desired.

The use of static memory for passing function arguments was necessary only in the very early computers, which were starved in registers.

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

#340

Earlier quoted context omitted.

They need to have very strict security clearance requirements and maintain them throughout the life of the project or their tenure. People don’t realize this isn’t some little embedded app you throw on an ESP32. You’ll be interviewed, your family, your neighbors, your school teachers, your past bosses, your cousin once removed, your sheriff, your past lovers, and even your old childhood friends. Your life goes under…

I went through the TS positive vetting process (for signals intelligence, not writing software for fighter jets, but the process is presumably the same). If I were back on the job market, I’d be demanding a big premium to go through it again. It’s very intrusive, puts significant limitations on where you can go, and adds significant job uncertainty (since your job is now tied to your clearance).

Yes but like a certification, that clearance is yours, not the companies. You take it with you. It lasts a good while. There are plenty of government companies that would love you if you had one. Northrop, Lockheed, Boeing, etc.
Post reply on HN