Live data from Hacker News

Why Ada Is the Language You Want to Be Programming Your Systems With

hackaday.com

161–170 of 330 posts

Re: Why Ada Is the Language You Want to Be Programming Your Systems With

#161
post #137

Earlier quoted context omitted.

Many of the 'programmers' of those days lacked the sophistication and education to appreciate Ada. Just the mojo required to print an integer (having to instantiate a generic) was considered complicated Ada was also very slow to compile, on the order of 10 times slower than Jovial. (my experiences) Avionics systems back then were tiny. Jovial usually ran on a 16 bit processor. Ada enabled a certain maturity and corre…

I can sympathize with resistance to Ada in a sense: Big "enterprise-y" languages can feel unwieldy and cumbersome if you're used to bit-twiddling and struct-packing in something like C. But as the recent Boeing debacle has shown, the avionics domain is in need of greater sophistication and reliability. What it doesn't need is more hackery, as satisfying as that may be for the hardware hackers. Though Ada isn't a mass…

The Boeing debacle is an example of software performing exactly to specification. The spec was the problem.

Re: Why Ada Is the Language You Want to Be Programming Your Systems With

#162

Earlier quoted context omitted.

What did Dijkatra like? Pascal?

ALGOL 60. https://en.wikipedia.org/wiki/Edsger_W._Dijkstra#Compiler_co... : ”Dijkstra was known to be a fan of ALGOL 60, and worked on the team that implemented the first compiler for that language. He was closely involved in the ALGOL 60 development, realisation and popularisation.” Also: Haskell and pascal over C++ and Java ( https://www.cs.utexas.edu/users/EWD/transcriptions/OtherDocs... )

…for CS instruction.

I've never come across any indication that Dijkstra wrote actual code (in the sense of something executing on a computer) after 1970 or so. The algorithms in the EWD notes are all written in ALGOL style pseudocode.

Dijkstra was the CS equivalent of the Patent Law concept of a "Non-Practicing Entity", which gave him great liberty to troll all programming languages without exposing his own choices or designs to corresponding scrutiny.

Re: Why Ada Is the Language You Want to Be Programming Your Systems With

#163
post #72

This article promotes a popular misconception of the programming situation for defense projects in the 1970s. There may have been "hundreds of specialized programming languages" in existence that could be used, but just a handful actually predominated. Most aeronautical projects were done in JOVIAL. I've talked about this history with engineers from the 1960s-70s. They did not regard the introduction of Ada as a good…

As I've probably posted before, I was at a Dijkstra lecture in the early 80s where he put up one of his famous hand-drawn slides that said "Ada: The latest government boondoggle that will take 5 years and 5 million dollars to kill." [5 million dollars was a lot of money back then.] So yeah, even the academics didn't much care for Ada.

I worked with a guy who worked on a ge defense contract in the late 80s that demanded ada as the design language. He worked there 2 years learning the language without writing any code before they laid the team off.

Re: Why Ada Is the Language You Want to Be Programming Your Systems With

#164

As a side note for people like me who have no option other than C for their safety critical projects, remember there's a MISRA-C standard. If that feels too much, [1] is a good starting point. [1] http://pixelscommander.com/wp-content/uploads/2014/12/P10.pd...

Thank you for the link! I think that’s really helpful and those are good explanations for each rule.

Does anyone know of a guide for writing C code where you allocate a specific block of memory at the start and then use that for all data from then on? Avoiding malloc is one of the suggestions there and seems like a smart strategy.

Re: Why Ada Is the Language You Want to Be Programming Your Systems With

#165
post #137

Earlier quoted context omitted.

I can sympathize with resistance to Ada in a sense: Big "enterprise-y" languages can feel unwieldy and cumbersome if you're used to bit-twiddling and struct-packing in something like C. But as the recent Boeing debacle has shown, the avionics domain is in need of greater sophistication and reliability. What it doesn't need is more hackery, as satisfying as that may be for the hardware hackers. Though Ada isn't a mass…

Wasn't the ill fated code itself written in Ada? That is essentially all that goes on boeing aircraft. I don't think a lack of software engineering rigor is to blame for the design mistake.

Possibly; I don't work for Boeing or their subcontractor. But I was getting at more of the general sense that as aircraft become more and more computerized we need more rigour and standardization of the sort that gave rise to Ada, and less of the aerospace equivalent of hacking things together in perl.

Re: Why Ada Is the Language You Want to Be Programming Your Systems With

#166
post #133
post #32

> Ada code controls rockets like the Ariane 4 and 5, many satellites, and countless other systems where small glitches can have major consequences. A somewhat amusing endorsement given that the infamous failure of the maiden launch of the Ariane 5 due to series of interconnected software bugs - a reminder perhaps that the choice of implementation language does not automatically make for a reliable system.

There's always someone who brings this up whenever Ada is mentioned, as if it serves as a damning refutation of Ada's reputation as a safe language. That bug was caused by a series of design failures if anything, rather than software bugs. From memory, they reused the inertial reference system from the Ariane 4 mission without testing its suitability for a different delivery vehicle. The actual 'bug' was caused by an…

> It's not some software bug caused by Ada.

This is not correct. It was, in fact, "some software bug caused by Ada", in the sense that in most other programming languages, the error that did in fact happen would have been harmless.

For those who are interested, the full report is at http://www-users.math.umn.edu/~arnold//disasters/ariane5rep..... There is no need to "guess" when a fairly detailed public analysis is available, particularly when the issue is one that comes up repeatedly. It is true that the problem was that a horizontal velocity variable ("horizontal bias", BH in the code) overflowed, although it was not the ordinary kind of integer overflow, but rather a floating-point-to-integer-conversion overflow, which does not produce an exception in any commonly-used programming language.

The missing piece of the explanation is that the variable in question was no longer being used at that point in the flight, so if the failure had been allowed to pass silently rather than shutting down the SRI ("inertial reference system"), the rocket would not have been destroyed.

Of course, under some circumstances, allowing variables to have grossly incorrect values in your inertial reference system could have been equally disastrous — that's what you assumed happened. The system was designed in the way it was because the assumption was that such errors would almost surely stem from hardware failures rather than software bugs; perhaps that is a "domain issue caused by a failure in management and testing".

But in some sense, you can argue that any organizational failure is a "failure in management", since management's job is to look to windward and steer the organization clear of failures by any means necessary. But in fact the particular failure in management that happened was for the software to be inadequately thought out, such that one of Ada's hidden pitfalls caused Ariane 5's maiden flight to fail.

Re: Why Ada Is the Language You Want to Be Programming Your Systems With

#167

Earlier quoted context omitted.

As I've probably posted before, I was at a Dijkstra lecture in the early 80s where he put up one of his famous hand-drawn slides that said "Ada: The latest government boondoggle that will take 5 years and 5 million dollars to kill." [5 million dollars was a lot of money back then.] So yeah, even the academics didn't much care for Ada.

What did Dijkatra like? Pascal?

He was teaching at UT Austin and Pascal was the CS department's pedagogical language of choice back then, so I presume the answer was yes. Or at least I never heard him say he hated it.

Re: Why Ada Is the Language You Want to Be Programming Your Systems With

#168
post #72

This article promotes a popular misconception of the programming situation for defense projects in the 1970s. There may have been "hundreds of specialized programming languages" in existence that could be used, but just a handful actually predominated. Most aeronautical projects were done in JOVIAL. I've talked about this history with engineers from the 1960s-70s. They did not regard the introduction of Ada as a good…

I'm sure that's all true. There is something to be said for a language that was written to a spec from the beginning, however. That is a luxury that few languages today can claim; most language specs were written after the first version(s) of the language were implemented, and were written to match the implementation, not the other way around. Writing the specification first makes for a much cleaner language, though…

Calling one language better than another is subjective and open to interpretation. Clean might not be as important as critical mass in adoption, letting people more efficiently find people to work on the software.

Re: Why Ada Is the Language You Want to Be Programming Your Systems With

#169
post #133
post #32

> Ada code controls rockets like the Ariane 4 and 5, many satellites, and countless other systems where small glitches can have major consequences. A somewhat amusing endorsement given that the infamous failure of the maiden launch of the Ariane 5 due to series of interconnected software bugs - a reminder perhaps that the choice of implementation language does not automatically make for a reliable system.

There's always someone who brings this up whenever Ada is mentioned, as if it serves as a damning refutation of Ada's reputation as a safe language. That bug was caused by a series of design failures if anything, rather than software bugs. From memory, they reused the inertial reference system from the Ariane 4 mission without testing its suitability for a different delivery vehicle. The actual 'bug' was caused by an…

>> he actual 'bug' was caused by an integer overflow occurring due to the velocity variable not being wide enough to handle the higher horizontal velocities of the newer rocket.

Something all that fancy type system should have prevented. I found it interesting in the Hackaday piece that the C code xample called out the size of an integer while the Ada version did not. The Ada version caught an implicit conversion, but apparently does nothing for overflow.

Every language has it's good points and bad. I still want to learn more Rust. In fact I recall reading recently that some Ada developers want to adopt something akin to Rust's borrow checker. All I know is that C++ is not safe. How well does Ada work with C libraries? Rust is pretty OK at it.

Re: Why Ada Is the Language You Want to Be Programming Your Systems With

#170
post #17

Earlier quoted context omitted.

Languages with the kind of constraints (sometimes kicked up to 11) that inspired the term “bondage and discipline languages” [0] have come back into vogue in a big way since the heyday of the Jargon File, and are in many cases the new “languages of choice” [1]. [0] http://catb.org/~esr/jargon/html/B/bondage-and-discipline-la... [1] http://catb.org/~esr/jargon/html/L/languages-of-choice.html

I remember reading the first entry many years ago and wondering why anyone would want to use a language with type enforcement when you could have duck typing. (I thought of types as something that had been enforced by the lack of expressive power of old languages in which the types were effectively closer to the machine -- like describing the size of a machine word or something.) Later on I experienced the famous fea…

Yes, I think there was very much a "formal methods winter", say from about 1985 to 2015; the Jargon File alludes to this in the "DWIM" entry, I think. Essentially, proving tiny programs correct became feasible in the mid-1960s, but only tiny programs were feasible to prove correct until the mid-oughts. Dijkstra died terribly disappointed.

During essentially this entire time period, the scale of what people were programming was growing much faster than the scale of what people could prove correct. If the aspirational task in 1995 was to prove correct a telecom switching system, the aspirational task in 2005 was to prove correct an AJAX frontend in untyped JS with its goofy coercion rules speaking over an unreliable network with MITM proxies to a backend written in untyped PHP, storing its data in a MySQL cluster where it would read from a read slave that was different from (and a poorly characterized latency period behind) the master it was writing to. Since then things have gotten more complicated, but I feel that formal methods have closed a bit of the gap.

However, I don't think of Ada as being a promising part of these developments. It isn't especially formally tractable, and it doesn't even attempt to offer the kinds of safety guarantees that Rust does. Rust, CompCert, seL4, Z3, Haskell, OCaml, and TLA+ seem a lot more promising than Ada. Heck, even Hypothesis is kind of in that category for me.

P.S. I miss you. I hope you're doing well.

Post reply on HN