Live data from Hacker News

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

hackaday.com

61–70 of 330 posts

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

#61
post #9

During weekend installfest/hackfest events at a LUG that I used to attend, there was always this one guy who would sit in front of a pair of laptops and code in Ada. One thing I remember about it is just how much it reminded me of Pascal.

Ada was built on top of Pascal so they are very similar. Another Pascal language is ST or Structured Text, an IEC industrial automation language specification for PLC's.

I remember fooling with Ada years ago and I really liked the concurrency and ipc mechanisms which was quite unique in the 00's. It was a little more friendly to use vs. pthreads. Now every new language is baking in concurrency. Since I wrote mostly c code I wound up making a franken program which was a statically linked Ada/c. I used Ada for its concurrency which called my linked in c code. It was a PLC emulator I scrapped.

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

#62
post #59

Earlier quoted context omitted.

That's not really the point I was making. Ada has been around since the 70's and at that time, was possibly the correct choice to make given the criteria. The question I asked at the end, and the title of this article, is why would I pick Ada today? The best reason I've seen is because it's already passed the hurdles in some industries as being a compliant language for their needs. That might be a good enough reason…

That seems like a trick question, because obviously you wouldn't pick Ada, you would pick Rust. And then you would talk about Rust, and mention how great Rust is, perhaps in a thread about Ada, which hadn't mentioned Rust at all. Or a thread about C, or about C++ or even about Go or why not even Python and JavaScript. But seriously now: the author didn't mention Rust because they probably don't even know it exists. I…

Hackaday has written several articles about Rust, though I don't believe any of them were by this author.

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

#63
post #29

Earlier quoted context omitted.

> Where is the mention of other new programming languages that also fit this category? Where is the mention of Rust? The article is about Ada. If you want to read about Rust, go read about Rust.

This article promotes Ada as the right language to use for systems programming; a good comparison would include a description of how it compares to other systems programming languages. History of why the DoD chose it in the 1970s, over the languages of the 1970s, doesn't explain why it's the right choice today . I don't read the comment you're replying to as asking for an article about Rust or any other language. It'…

bluejekyll does chastise the author for not including their favorite programming language and I don't think that's a legitimate criticism at all.

Yes, most systems programming is done in C and C++. Some people even use Rust, I've heard. Doesn't mean that an article has to draw comparisons to these languages. In fact, almost every article comparing programming languages inevitably does a poor job at it because the author most likely is more familiar with one language and then we'd have people criticizing the author because they got X, Y and Z wrong.

I have seen this a lot of time on HN. It's simply smart to not compare languages.

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

#64
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.

A language doesn't make code automatically reliable, but it can certainly help.

Ada can do overflow checking, so choice of language can have an impact on reliability, but the software engineers deliberately disabled some of those checks to save CPU cycles on a computer that was running at/near capacity. Their reasoning was that it was impossible for the variables in question to overflow given the known flight characteristics... of an Ariane 4.

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

#65
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 was not that way even then.

It's a tongue-in-cheek document, made by imbeciles, not some real language evaluation...

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

#66
post #34

If you've done VHDL, you'll be familiar with Ada's syntax. When the DoD commissioned the design of VHDL, they required that its syntax be based on Ada. https://en.wikipedia.org/wiki/VHDL#History

They started with Ada's syntax and tacked on strange things that do not fit in, e.g., the ".all" in use clauses.

For people wondering what ".all" is about:

https://en.wikibooks.org/wiki/Ada_Programming/Types/access

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

#67

I've developed a set of "strongly typed" classes in C++ that have saved me a ton of grief. Here are some examples. All classes are fundamentally floats. Errors are caught at compilation. cInches i1, i2, i3; cCm cm1, cm2; i1 = 1.f; // error i1 = cInches(1.f); // OK i3 = i1 + i2; // OK cm1 = i1; // error i1 = i2 * 2.f; // OK float f1 = i1 / i2; // OK i1 = i2 * i3; // error! square inches are not inches int add(cInches…

There's a few libraries which implement this for all units in e.g. SI, like boost units or nholthaus/units on github. There's also the safe numerics lib in boost which catches UB and other issues around integer operations preferably at compile time and, if not possible, at run-time.

From what I read about Ada, its types offer better guarantees than what's typically available in mainstream programming languages: https://learn.adacore.com/courses/intro-to-ada/chapters/stro...

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

#68

There is some overlap in the use cases between Ada-in-the-mainstream (which seems to be what the article is suggesting) and Rust. The existence of Rust will make it even harder for Ada to break out of its existing domains. Both seem to have good ecosystems, but quite different. Ada has more high-assurance tooling and practices. Rust has more in terms of packaging and general-purpose high level libraries. With Ada, it…

Having a big ecosystem of libraries is not even close to a big concern when developing critical applications like what Ada seems to be used for.

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

#69
post #37

Earlier quoted context omitted.

TIL VHDL was commisioned by the DoD. Also random note, but wouldn't most engineers familiar with HDL's be electronic engineers rather than software developers?

A lot of people trained as EEs seem to end up in software dev jobs these days.

Yep. You don't find many EEs left in the US these days, unless they work at a military contractor. All the electronic hardware design work went to Taiwan and China, because that's where all the manufacturing for it is. What's left is government-related (military) stuff that obviously can't be outsourced to Asia, and some commercial stuff that they keep in-house for various reasons.

Basically, the US is a really bad place to be an electrical engineer specializing in electronic hardware, but it's a great place to be a software engineer or developer.

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

#70
post #63

Earlier quoted context omitted.

This article promotes Ada as the right language to use for systems programming; a good comparison would include a description of how it compares to other systems programming languages. History of why the DoD chose it in the 1970s, over the languages of the 1970s, doesn't explain why it's the right choice today . I don't read the comment you're replying to as asking for an article about Rust or any other language. It'…

bluejekyll does chastise the author for not including their favorite programming language and I don't think that's a legitimate criticism at all. Yes, most systems programming is done in C and C++. Some people even use Rust, I've heard. Doesn't mean that an article has to draw comparisons to these languages. In fact, almost every article comparing programming languages inevitably does a poor job at it because the aut…

If the article had a title of, "Ada is a great language for embedded", then great. But it's implying that Ada is the only language that exists today that can accomplish this task, and that's just not true. Rust is merely one example, and the best I know. And the tooling of these modern languages perhaps are better reasons to use them than Ada.

But yes, perhaps I was too critical, it's mainly the title that is a little misleading, and then the content didn't express anything specific about Ada that other languages don't also have.

Post reply on HN