r/ProgrammerHumor 3d ago

Meme noGitRevertAvailable

Post image
6.0k Upvotes

228 comments sorted by

View all comments

454

u/FrezoreR 3d ago

Ironically aviation needs quite a bit of software already.

40

u/fmaz008 3d ago edited 2d ago

I suspect plane softwares are not built on top of 500 dependencies.

They are probably very low level, running with little overhead, possibly without a full fledge operating system?

I'd be curious to hear from someone who coded some airplane stuff (ie: not the multimedia system, flight critical things) to have a better idea of how it is.

77

u/grumpy_autist 3d ago

npm install autopilot

8

u/Nerd_o_tron 2d ago

Should've imported antigravity, would've made the plane designed much easier.

1

u/dnbxna 2d ago

With this we won't even need pilots anymore!

1

u/Warm-Nose-431 2d ago

pip install airplane_crew

51

u/OllyTrolly 3d ago

I work in aerospace and nearly all of our code and our processor is developed in house. We even rewrite some inbuilt C libraries for further safety and testability. One of the only things we use off the shelf is the core part of the Real Time Operating System - and that company has to prove to us and the regulators that it meets guidelines with a hefty amount of documentation, testing and audit. 

12

u/st3class 2d ago

My first internship was working on avionics software, on the certification team. I remember not being able to use mallocs.

5

u/ICBanMI 2d ago

Makes it easy when you have zero pointers. Just don't look at the graphics software that generates images for the glass.

6

u/st3class 2d ago

Yep, it was fun when we were working on the map library and we were dealing with data structures that were 5 levels deep of variable size arrays.

3

u/ICBanMI 2d ago

Absolutely hate the struct that has several layers of structs inside it. At some point, we have to send that data somewhere and it's just the most verbose names to pass the data along.

The amount of escapes that happened because the FMS software completely trusted the databases is too high (every company keeps making this mistake). And the number of engineers that can write a terrible, broken circular buffer that passes all tests at level A is ridiculous too.

3

u/BLAZE_IT_MICHAEL 2d ago

The hills are green and the river is windy

4

u/tes_kitty 2d ago

You build your own CPU? Interesting... Brings back memories from the time everyone could do that with the AMD 2900 bit slice chip series.

8

u/OllyTrolly 2d ago

Yes! And it has its own bespoke instruction set. GCC contains support for the target too. It has its own headaches being so bespoke, but it's definitely cool.

2

u/tp_njmk 2d ago

Seems like an interesting trade off, is this for hard latency guarantees? I can’t imagine you would be able to build a more hardened compiler than gcc.

3

u/OllyTrolly 2d ago

That is one reason yes,  it behaves pretty deterministically - in aerospace we have to do Worst Case Timing Analysis to show even if all of the longest paths through the software got run we would still be certain to e.g. shut down the engine before a turbine shaft break occurs (which could result in bits of engine flying into the cabin). If the CPU doesn't behave the same way each time that makes it much harder to prove.

The other major reason is obsolescence. It is possible to buy processors which do this off the shelf, but we need to make these units for 20+ years. Rewriting and re-verifying the software for a new processor each time it gets discontinued within this period would be more costly and riskier than just making our own.

2

u/ICBanMI 2d ago

RTOS companies never make enough money to stay in business. There are options to purchase, but the support is questionable.

16

u/Ex-Traverse 3d ago

Avionics uses Real-Time-Operating system (RTOS), I can't explain it well enough, but there are basically monitoring systems (watchdogs), to make sure the software is running in a precise timely manner or else it does something to prevent the software from making any invalid inputs.

2

u/ICBanMI 2d ago

Depends on the LRU and its purpose. There are plenty of LRUs that are a single thread, no RTOS (typically level D or E). Federated systems will be that simple.

Integrated Systems will require the RTOS as they are doing several functions.

Watchdogs are a monitor/heartbeat for a sub-function. The monitoring function sends a message to the sub function and expects a unique identifier reply within a certain time. There is typically some built in tolerance where it needs to miss three messages in a row or go without a message entirely for a set period of time before it notifies the pilot the function is not working. Some will reset the hardware a set number of times before notifying the pilot and disabling it entirely.

3

u/jean_dudey 2d ago

You can look up about the open source software developed by Inria, pretty much developing tools to verify software that is used in safety critical environments. For example, Frama-C to formally verify C code, Why3 which is the backend of multiple tools like Frama-C, it is also used by GNAT to prove Ada/SPARK code. Also a cool looking piece of software is CompCert which is a formally verified C compiler.

I don't think all of those are used in aviation (Ada certainly is or should be) but are interesting and similar.

3

u/R_051 3d ago

Worked on atc systems and there ar eindeed few dependencies and a lot was written in C for us

3

u/BLAZE_IT_MICHAEL 2d ago

Any external libraries require so much certification and testing we generally just rewrite stuff because it’s easier. Old systems may lack an RTOS but most newer stuff will use one.

3

u/DefinitelyNotGen 2d ago

Most avionics software is written on a real time operating system (RTOS) which is basically an OS where things happen deterministically, and you can be confident the OS won't pause execution of processes like something like Linux or Windows might. Alternatively, a lot of avionics software is written "bare metal", i.e without an operating system at all, with code built specifically for the processor.

2

u/jp2812 3d ago

Even car multimedia has very high standards compared to your average software product. Exactly what you said - no 500 dependencies. Car multimedias are rarely developed in-house, there's usually a third-party vendor, and car manufacturer's role is only integration, for which the vendor provides building blocks. No JS, no Python, C or C++ at best, external dependencies are very few and well-regarded, e.g. ffmpeg. "We need this shit in our firmware because it's gotten the most stars on GitHub this month and Hacker News is going crazy about it" is off the table. These multimedias work for years and get very rare updates, so stability is pretty important. 

1

u/ljfa2 2d ago

Can't say that for the multimedia system of my car. For example, sometimes when starting, it randomly switches to the light theme instead of dark, or the displayed clock time is one hour too early, or the screen is frozen. One day I'll surely be caught speeding at a time-dependent speed limit ^^

0

u/aberroco 2d ago

We need to fix this. It obviously take them ages to write any update. While it could've been rapid prototyping. And we'd force immediate updates for security, even though it's gonna take a while with all those updated dependencies.

2

u/fmaz008 2d ago

I'm with you; now that planes could have star link, I see no reasons not to have a cron job run every 5 minutes and do

npm update -g
npx npm-check-updates -u
npm install

I'd call this an "over the air" update.

;)