Today my lecturer mentioned the reason why the aircraft system is programmed in assembly language is due to the program being written have less error . Is this statement true ? Because when he asked about our opinion I said assembly can create faster program thus it is a good language for real-time oriented aircraft system program . I search around google but can't seem to find an article clarifying my lecturer's statement .
-
24Either you misunderstood your lecturer or your lecturer is an idiot. – Paul R Oct 23 '12 at 07:55
-
3You do *not* want to write real-time critical-equipment control software in assembly. There are much better languages available for both real-time-software development and critical software development. – user Oct 23 '12 at 08:08
-
I certainly think i didn't misunderstood what the lecturer said as i keep contemplating about his question and he also repeat his question 3 times – caramel1995 Oct 23 '12 at 08:36
-
5Just wondering about your lecturer's age. Anyway, he might have only tried to point out, (kinda failing, apparently) that a number of modern languages, such as java, are off-limits (java has this spelled out in it's accompanying license, btw) for aircraft-related mission-critical applications. – ZJR Oct 23 '12 at 08:43
-
1@ZJR: Actually, AFAIK, a German UAV manufacturer uses Java for the flight control system. Maybe they bought a different license? – Jörg W Mittag Oct 23 '12 at 11:56
-
haha that's the reason why i asked here because I think what my lecturer told me was wrong . I've a bad habit which is I don't easily accept answer without valid sources or idea that against my logical brain – caramel1995 Oct 23 '12 at 12:09
-
I have a question , does assembly language really less error prone compare to program being written in high level language?? – caramel1995 Oct 23 '12 at 12:12
-
@caramel23: No. First off, assembly needs more code to do the same thing. More code == more (potential) errors. Secondly, assembly is "anything goes", you can do everything, there are no restrictions. The more restrictions you have, the easier it becomes to prove properties about the program, both for humans and for machines. Extreme example: in a Total Language, all programs always terminate. The Halting Problem simply doesn't apply. – Jörg W Mittag Oct 23 '12 at 13:00
-
1@JörgWMittag: a UAV might be able to kill people by other methods, but the 'U' means a failure of flight control means it isn't immediately jeopardizing human life. The Java license says it isn't *suitable* for mission-critical systems, but that doesn't prevent anyone from making that choice. – DaveE Oct 23 '12 at 17:59
-
Related: [What operating systems are used in airplanes, and what programming languages are they developed in?](http://programmers.stackexchange.com/questions/153266/what-operating-systems-are-used-in-airplanes-and-what-programming-languages-are) – user16764 Nov 21 '12 at 17:31
-
@JörgWMittag perhaps the instructor meant that you have full control over what is going on, rather than having to rely on a compiler and several libraries. – Hawken Jan 06 '13 at 02:28
2 Answers
Your lecturer's statement is provably false. The Joint Strike Fighter's control code is written in C++. The 777 from Boeing uses 99%+ ADA. The JPL uses mostly C to drive spaceships.
I'm sure there are more examples but I suspect many are proprietary or classified.
Here is a paper that goes into some detail on the subject of testing avionics software on a more general level.
-
Some NASA projects also used a Lisp dialect in the past. A German UAV manufacturer even uses Java. – Jörg W Mittag Oct 23 '12 at 11:55
-
The B2 bomber's was recently rewritten in C. Source: http://tech.slashdot.org/story/08/07/14/1934228/b-2-stealth-bomber-gets-upgrade-joins-the-90s – user16764 Oct 23 '12 at 14:15
-
Back in the Dark Ages (early 1980s), F-16A/B used assembly language for the Stores Management Set and JOVIAL J3B for the Firecontrol Computer. F-16C/D used JOVIAL J73 for everything for the first few blocks, and I believe they switched over to Ada in later years. I don't know what they're using today. – John R. Strohm Oct 23 '12 at 16:51
I work on OBOGS, which is a component that gets plugged into various aircraft. We typically use C for the devices that fly, but looking through the historical files, there are a couple of assembly projects in there.
It's fashion, honestly. Languages rise and fall. The reasons people use one or the other vary all over the place and are mostly subjective. I find it completely plausible that someone at some point argued that assembly was the right choice for some project somewhere entirely because it would have less errors than in any other language. And he was probably right, but that's because the guy didn't know how to code in C worth a damn. By and far the best language for the job is the one you know. (And the best language for your personal growth is one you don't.)
You can objectively say that assembly is closer to the hardware, less abstracted, more direct, with more instructions to the same thing in other languages. You can even say that it's in the realm of possibility that assembly can be written to cut out overhead and be smoking fast. If you know what you're doing. But as for error-prone-ness, speed of development, readability, and the ability to cure cancer? All that depends on the ability of the programmer and what they've worked in for the last 20 years. Measurements of which projects with which language have X amount of bugs are subject to sociological factors, largely making them worthless metrics. No, it's all just so much fashion.
It's good to know what your code boils down to, so I'm going to say that it's important to learn assembly. If only a little. But I wouldn't write any avionics in it.

- 6,742
- 27
- 43
-
1I the end, writing assembly means less machine code overall if you know what you're doing, and you know pretty much exactly what the resulting machine code will look like; you don't have to trust a compiler to get it right for you. – Hawken Jan 06 '13 at 02:35