Live data from Hacker News

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

youtube.com

261–270 of 451 posts

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

#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/html/prodinf/janus95/j-ada95.htm

What is true, is that those vendors, and many others, like UNIX vendors that used to have Ada compilers like Sun, paying for Ada compilers was extra, while C and C++ were already there on the UNIX developers SKU (a tradition that Sun started, having various UNIX SKUs).

So schools and many folks found easier to just buy a C or C++ compiler, than an Ada one, with its price tags.

Something that has helped Ada is the great work done by Ada Core, even if a few love hating them. They are the major sponsor for ISO work, and spreading Ada knowledge on the open source community.

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

#262
post #249

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

The exact opposite of what you suggest already happened: Ada was mandated and then the mandate was revoked. It’s generally a bad idea to be the only customer of a specific product, because it increases costs. > And the F35 and America's combat readiness would be in a better place today with Ada instead of C++ What’s the problem with the F35 and combat readiness? Many EU countries are falling over each-other to buy it…

> What’s the problem with the F35 and combat readiness?

Block 4 is very delayed for starters.

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

#263
post #198

Earlier quoted context omitted.

std::vector allocated and freed on the stack will allocate an array for its int’s on the heap…

I've heard that MSVC does (did?) that, but if so that's an MSVC problem. gcc and clang don't do that. https://godbolt.org/z/nasoWeq5M

WDYM? Vector is an abstraction over dynamically sized arrays so sure it does use heap to store its elements.

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

#264
post #249

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

The exact opposite of what you suggest already happened: Ada was mandated and then the mandate was revoked. It’s generally a bad idea to be the only customer of a specific product, because it increases costs. > And the F35 and America's combat readiness would be in a better place today with Ada instead of C++ What’s the problem with the F35 and combat readiness? Many EU countries are falling over each-other to buy it…

> Many EU countries are falling over each-other to buy it.

It's because we are obliged to want more freedom.

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

#265

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…

For situations where you do want to handle allocation failure, GLib provides g_try_malloc and related functions that can return NULL. The key insight is making the common case automatic and the exceptional case explicit. The g_new macro is particularly nice because it is type-aware. Instead of writing g_malloc of sizeof times count and then casting, you write g_new of type and count, and it handles the sizing and cas…

You missed the part that GNOME was started due to differences with KDE licensing, and original FSF was against C++ due to religious reasons, and even if KDE/QT license had been GPL compatible, they would not adopted it.

If you look around outside Linux world, everyone was going into C++, PC world with OS/2, MS-DOS and Windows, Apple, Epoch (later Symbian), BeOS,.... UNIX was playing with CORBA, OpenInventor,....

Here the original version of the GNU Manifesto,

"Using a language other than C is like using a non-standard feature: it will cause trouble for users. Even if GCC supports the other language, users may find it inconvenient to have to install the compiler for that other language in order to build your program. So please write in C."

The GNU Coding Standard in 1994, http://web.mit.edu/gnu/doc/html/standards_7.html#SEC12

Moving a bit forward to 1998, when GNOME 1.0 was still being made ready,

"Using a language other than C is like using a non-standard feature: it will cause trouble for users. Even if GCC supports the other language, users may find it inconvenient to have to install the compiler for that other language in order to build your program. For example, if you write your program in C++, people will have to install the C++ compiler in order to compile your program. Thus, it is better if you write in C. "

https://www.ime.usp.br/~jose/standards.html#SEC9

Yes, the actual version is a bit more welcoming to programming language variety,

https://www.gnu.org/prep/standards/html_node/Source-Language...

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

#266
post #249

Earlier quoted context omitted.

The exact opposite of what you suggest already happened: Ada was mandated and then the mandate was revoked. It’s generally a bad idea to be the only customer of a specific product, because it increases costs. > And the F35 and America's combat readiness would be in a better place today with Ada instead of C++ What’s the problem with the F35 and combat readiness? Many EU countries are falling over each-other to buy it…

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

The pilots might have reassessed after Pakistan seemed to have shot three of them down from over 200km range. Intel failure blamed but likely many factors of which some presumably may be attributed to the planes.

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

#267
post #107
post #105

Earlier quoted context omitted.

Not if you use GCC. https://godbolt.org/z/zYdc9ej88 clang gets this right.

It does work in GCC to suppress unused variable warnings. Just not for function calls I guess.

__attribute__((maybe_unused)) or [[maybe_unused]] or such things (dependin on ur spec version i guess?) can be used not to disable a whole line of errors.

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

#268
post #249

Earlier quoted context omitted.

The exact opposite of what you suggest already happened: Ada was mandated and then the mandate was revoked. It’s generally a bad idea to be the only customer of a specific product, because it increases costs. > And the F35 and America's combat readiness would be in a better place today with Ada instead of C++ What’s the problem with the F35 and combat readiness? Many EU countries are falling over each-other to buy it…

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

Much of existing European F-35 fleet predates Trump's first term. In fact now quite the opposite happens: other options being eyed from reliable partners, even if technically inferior.

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

#270

Earlier quoted context omitted.

Golang is exactly the same. It's extremely annoying until it's suddenly very useful and has prevented you doing something unintended.

I fail to see how a warning doesn't achieve the same thing while allowing you to iterate faster. Unless you're working with barbarians who commit code that complies with warnings to your repo and there is 0 discipline to stop them.

Go is a very opinionated language. If you don't like K&R indentation, tough - anything else is a syntax error.

It's kind of like the olden days.

Post reply on HN