Live data from Hacker News

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

hackaday.com

221–230 of 330 posts

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

#221
post #215

Earlier quoted context omitted.

> The 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. This caused the rocket to go off course and require termination. This is not entirely correct. The code which overflowed was unnecessary for flight. People have this idea that the sensor sensed it was going 32745 m/s to the east one moment, a…

You could have condensed your entire post to just "This exception was uncaught". Your last point is just outright ridiculous: > "Rust improves upon this situation by panicking in debug mode and wrapping in release mode, which is better than the Ada behavior in every possible" So... What you're trying to tell us is that Ada recognising an exceptional situation has occurred is bad, and that Rust just ignoring it is a g…

Tainting the dataflow rather than the control flow, like a quiet NaN, would be a better solution in cases like these. It happens that the solution that was chosen was the worst choice possible, but in other cases it wouldn't have been.

Probably the fact that the engineers got the case analysis wrong suggests that the methods of reasoning they were using weren't very effective. Modern formal methods might or might not have helped; guaranteeing that a piece of code is statically free of exceptions is not a terribly advanced thing to do, but really you'd like to guarantee that the variable was actually big enough. Having less code to reason about certainly would have helped.

C’s choice is clearly unconscionable.

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

#222
post #218
post #195

Earlier quoted context omitted.

Ada is miles ahead of Rust when it comes to C interoperability. I posted this before in one of the other Rust threads, but you can't get more than two paragraphs through the official Rust FFI documentation ( https://doc.rust-lang.org/nomicon/ffi.html ) before being asked to install a third-party dependency. The 'Interfaces.C' package is defined in the Ada language specification. And, as others have mentioned, Ada's l…

There's nothing wrong with pulling in the `libc` dependency. It literally means adding two lines of code and then `cargo` manages everything for you. It isn't really third-party; the owner is "rust-lang:libs". I understand that people are conditioned to think APIs are easier to consume when they're in the standard library, because that's true in many languages, especially those that lack a modern package management s…

Having libc updated multiple times per month sounds like a fucking nightmare to me. What am I missing about this situation?

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

#223

Earlier quoted context omitted.

The software in the case of the 737 max performed exactly according to the spec. The problem is that the spec was buggy. The language can't fix a buggy spec. Note that the bug which caused the Ariane V disaster was written in Ada. And that was caused by the language. If the Ariane V code was written in C and the value simply overflowed, nothing negative would have happened. (The value would be hilariously wrong, but…

The issue with Ariane V was the lack of integrated testing. If they had coupled the testing of the software with increased acceleration levels generated by a simulated Ariane V instead of an Ariane IV, they would have caught the issue. But let's say this was something unexpected - then probably the only way to mitigate this would be a backup system - but this is an unmanned system - and Apollo/Saturn/Shuttle/Soyuz le…

Yeah requirements were woefully incomplete, testing insufficient and may I add design where one unreliable sensor was wired to one processor which was given great authority over a system to wind in one direction very fast and where manual reversing out of was very slow or impossible when speeds got high (improbable when pitch directs you down).

How could anyone believe this system was safe? No testing or requirements needed.

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

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

Software engineering is neither science nor art, it’s a craft; one where the raw materials are pure arbitrary logic and data, and therefore having much broader scope than crafts tied to physical materials, but a craft nonetheless.

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

#225
post #5

I first read about Ada in JARGON: Ada:: n. A {{Pascal}}-descended language that has been made mandatory for Department of Defense software projects by the Pentagon. Hackers are nearly unanimous in observing that, technically, it is precisely what one might expect given that kind of endorsement by fiat; designed by committee, crockish, difficult to use, and overall a disastrous, multi-billion-dollar boondoggle (one co…

The situation hasn't changed, ESR just flat-out never had a good read on Ada. You really cannot take the Jargon file seriously, its author's ignorances are glaring and numerous. Ada's "elphantine bulk" is smaller than many modern languages, and even some which the Jargon File praises, like Common Lisp. Its inter-process communication and exception handling functionality were relatively forward-thinking at the time an…

Having learned Ada (or rather, taken a class that used Ada) back around 1990, at the time, it was a bloated monstrosity. It's just that over the past 30 years, C++ has bloated to such a size that it now dwarfs Ada (in my opinion).

Now, at the time, I didn't mind Ada (I think I was the only one to not mind it in class), but learning it just after K&R C/ANSI C (C was just recently standardized), it did appear to have quite a bit more overhead than I was used to.

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

#227
post #52

Earlier quoted context omitted.

> ...unsafe operation in one section of code (say, an imported library) can have negative impacts on unrelated sections of code otherwise deemed safe. Yeah. Just like every line in C/C++ code can have negative impacts on unrelated sections. While true, that talking point feels somewhat unfair or even in bad faith. Rust requires "unsafe" escape hatch to be able be a low level systems language. Or gasp, to call librari…

This comparison is against Ada's language criteria, not C/C++. You're well above 100% right with your points, if we weren't looking at the language criteria put forth by Ada. EDIT: It's worth nothing that Ada is also a system and embedded programming language.

Ada has unsafe code as well and messing it up causes exactly the same thing as it does in Rust or C++, so I'm not sure what your point is.

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

#228

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.

Some of them are, just not on every country. Here are the examples for Portugal and Germany.

https://www.ordemengenheiros.pt/pt/a-ordem/colegios-e-especi...

https://www.vdi.de/

Although you can get by without the admission exam, some kind of state projects do require it for any engineer putting their name on the contract assignment.

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

#229
No you shouldn't be writing in Ada. Embedded software running all kinds of sensitive workloads, from pacemakers to routers/switches use C for it's superior tooling, universal support across compilers and chip vendors, massive user base and decades long best practices (like NASA's C coding guidelines) to mitigate some of C's potential inadvertent misuses.

Not to mention the bevy of advanced niche features, like SIMD support, and custom GCC extensions that lend superpowers to C coders that other languages typically lack.

Sure, ada may have it's benefits for certain narrow use cases, but for non-hobby projects spanning tens/hundreds of engineers, considering real world vendor support for ada and missing talent pool, C is the obvious choice

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

#230

Earlier quoted context omitted.

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…

Before C was even a thing, plenty of computer systems got developed in Algol dialects for systems programming, like ESPOL, NEWP, PL/I, PL/S, Algol RS,...
Post reply on HN