Live data from Hacker News

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

hackaday.com

201–210 of 330 posts

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

#201
post #198

Earlier quoted context omitted.

There is something to be said for not just halting on an error in production systems. Its the same reason assertions are usually turned off on production builds. Yes ideally the programmers should have handled the exception, but once your in production and the system is running, should you really just halt the whole program due to an exception the prograera didn't foresee?

For mission-critical software like avionics or a nuclear power plant? Absolutely! At design time you better figure out what all the error cases are, and blindly steamrolling over them when they should be triggered makes a bad problem worse (e.g. look at Cloudbleed where unchecked out-of-bounds reads starts disclosing other people's banking information). Assertions are also usually turned off for performance reasons,…

Uncaught exception and die.

For a banking application, yes, die, hard, as loudly as possible. Downtime is worth it. Do not continue, do nothing until it is understood and fixed.

When you're flying. Hmmm. Not so much. Dying is a really bad idea. Ok you should have it tested thoroughly so it isn't going to happen but if it does and "anything could happen" well "anything" is better than killing all the passengers, crew and anyone you might crash on, right?

Literally anything is better than that.

Idealy, you log it, you refuse to take off again, all the fleet is grounded etc etc but deciding to fall out of the sky because something unexpected happened is probably not the right response.

Is graceful shutdown possible? No? Ok, so take your chances and log noisily is a less bad option.

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

#202
post #189

Earlier quoted context omitted.

> "If the Ariane V code was written in C and the value simply overflowed, nothing negative would have happened" So... what you're saying is that the language not recognising an exception conditional has occurred is a better outcome in mission critical applications? "wasn't necessary", "It was an oversight", "Which was uncaught"... With these phrases you've already pointed out that the developers had improperly implem…

There is something to be said for not just halting on an error in production systems. Its the same reason assertions are usually turned off on production builds. Yes ideally the programmers should have handled the exception, but once your in production and the system is running, should you really just halt the whole program due to an exception the prograera didn't foresee?

No, the process manager should log the stack trace, restart the subsystem and try running a few more times, then try an auxiliary system or just fly without the subsystem. It should not halt the whole software.

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

#203
post #191

I live near Sydney University ( not my alma-mater ). In a rather serendipitous turn, one day on my way home from the shops I was walking past one of the USYD buildings and there was a giant stack of library books that had thrown out onto the sidewalk as rubbish to be collected by the council. It turns out they were old science faculty books that were no longer prescribed material. I started looking through them and f…

I look forward to seeing your OS example.

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

#204

Earlier quoted context omitted.

Nice fixed point types too. A fixed point all to the right of the binary point to represent angles asa semicircle was useful. Table ovelays are evil though. I'd rather have rust than ada for the functional lineage along with the performance, but the thin stdlib combined with the difficulty of getting a crates.io mirror certified clean of malcious code makes it problematic.

Not to say Rust is ready for prime for safety critical systems, but both crates.io and the standard lib are optional for Rust.

I think it is probably closer to safety critcal than it is to the middleground of safety related, where the sloc hits millions so you want boost or a thick stdlib plus posix but its still controlled enough you develop airgapped and worry about number of library contributors, trustedness and mostly futile code inspections of entire libraries. Even for server backends the rust team has expressed concern about the security implications of having such deeply nested dependency trees with so many authors.

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

#205

Earlier quoted context omitted.

You can get Rust binaries just as small; the smallest known one was 145 bytes. Some defaults were recently adjusted to make them smaller by default too. https://github.com/tormol/tiny-rust-executable

Nobody wants to play with their compiler to get a small binary. Languages are typically judged by their defaults. If rust can produce small binaries, then it must produce small binaries.

[deleted]

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

#206
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…

Until software engineers are personably liable for their work like civil and mechanical engineers are and have to carry insurance because they will get sued for negligence if there are issues, it’s not professional engineering.

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

#207

Earlier quoted context omitted.

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…

Until software engineers are personably liable for their work like civil and mechanical engineers are and have to carry insurance because they will get sued for negligence if there are issues, it’s not professional engineering.

Software engineers are personally liable for their work. It's just that it's much more difficult to prove the various elements of negligence in the software realm, which makes litigation costly and uncertain. How negligent is an arithmetic overflow in a free software library that causes the loss of # of ads clicked for 10,000 Facebook users? Could the developer have foreseen the use case? What's the value of that loss?

An arithmetic bug in a flight safety system or financial trading platform? Your odds of being successfully sued just went up astronomically as it's much easier to show negligence and put a dollar figure to damages.

Professional licensing regimes are principally designed to prevent negligence by a priori preventing people from holding themselves out as capable of performing some task. In terms of legal liability all they really do is restrict the extent to which you can limit your liability contractually. That's important in business and in professional services (doctor, lawyer, etc), but for downstream users who suffer damages there was never a contract involved, anyhow.

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

#208
post #118

Earlier quoted context omitted.

>as the desperate need to get something safer than C/C++ without compromising performance and interoperability Object Pascal D ATS Common Lisp Ada even Fortran!! the list can go on and on

I think the fact that all of those have been around for decades, and yet haven't gained much traction, implies that there's something wrong with them that makes them unsuitable. If it's just a matter of marketing and failing the subjectivity of a popularity contest, that's a shame, but I wouldn't leap to assume that's the sole reason.

Go?

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

#209
post #183
post #166

Earlier quoted context omitted.

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

Forgive the use of "from memory" in my original post. I was on the move and didn't have time to reference the original material in-depth. You're correct. You've given a great explanation of the accident. Whenever this is brought up, I feel the need to rebuke the insinuation that this accident was explicitly caused by the use of Ada. You are correct in that the accident was the result of an exception caused by an over…

This conversation is everything I love about HN. Thoughtful, informative conversation, correction without offense--and so we all benefit. Thank you guys and thanks to dang for keeping this such a great forum!

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

#210
What about Forth?

I quite like the way it eschews too much abstraction and can go from very low level to high level with a lot less code (and less bugs).

Given the current interest with IoT and the proliferation of cheap micro controllers it might be due for a resurgence(?).

Post reply on HN