Live data from Hacker News

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

hackaday.com

51–60 of 330 posts

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

#51

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…

I understand what you're getting at here I tbink, but one of the ecosystem challenges we run into is that while Rust is abstractly a fantastic choice for the domain of systems development that would often be served by Ada (in fact we think it's a lot better in some respects because we can do more statically ahead of time, that Ada does dynamically at runtime, by abusing the Rust type system and borrow-checker), the Rust ecosystem isn't really focused on this class of problems.

There's significantly more attention provided to things like Wasm than there is to things like embedded use cases for example.

The two languages, ecosystems, and communities seem to have largely non-overlapping objectives despite having overlapping technical capabilities.

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

#52

First, this is a great introduction article to Ada. It's a great history lesson, and analysis of where it's used and why. That said, it seems to be arguing for something in a vacuum. Where is the mention of other new programming languages that also fit this category? Where is the mention of Rust? Rust fits all the same requirements: - A general, flexible design that adapts to satisfy the needs of embedded computer ap…

> - Easy to implement the language specification. All features should be easy to understand. I'm not sure this is at all applicable to rust. Perhaps once there are more than the one, quickly mutating, implementation, we can say that it's easy to implement the specification. > - Reliability. The language should aid the design and development of reliable programs. This one feels a touch questionable, given the built-in…

> ...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 libraries using C ABI.

I write a lot of low level code in C/C++ (firmware, kernel drivers, low level services) and I think a C ABI compatible "runtimeless" safe language, like Rust, dramatically improve security, safety and even ultimately provide faster time-to-market.

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

#53

Earlier quoted context omitted.

Rust cannot be used in most professional use cases where Ada programs can be deployed because the Rust toolchain isn't a qualified one for any of the various IEC 61508 derived qualification regimes. Which is a shame, because Rust is a great fit for these use cases. Though there are a lot of ecosystem shaped things that present practical challenges too: things that should/could be in no_std but unnecessarily depend on…

> There's a group in Germany (I think) that proposed attempting to qualify Rust to get it approved for inclusion in the list of 61508 languages, but that proposal did not seem to be met with much enthusiasm. https://ferrous-systems.com/blog/sealed-rust-the-pitch/ There's still a lot of interest; this stuff doesn't happen quickly.

I got the impression folks were lukewarm to it with concerns about what it would mean with respect to Rust's rolling release cycle and other shapes of incongruent goals between how to manage Rust as a big project and what it takes to maintain compliance for standards purposes.

I would be thrilled to death for that effort to move forward with zeal however. If a WG develops around it, I'd also happily provide engineering resources to coordinate and work on the effort.

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

#54

Earlier quoted context omitted.

> There's a group in Germany (I think) that proposed attempting to qualify Rust to get it approved for inclusion in the list of 61508 languages, but that proposal did not seem to be met with much enthusiasm. https://ferrous-systems.com/blog/sealed-rust-the-pitch/ There's still a lot of interest; this stuff doesn't happen quickly.

I got the impression folks were lukewarm to it with concerns about what it would mean with respect to Rust's rolling release cycle and other shapes of incongruent goals between how to manage Rust as a big project and what it takes to maintain compliance for standards purposes. I would be thrilled to death for that effort to move forward with zeal however. If a WG develops around it, I'd also happily provide engineeri…

I'm not directly involved, so I can't say too much, but the general advice of "comments on the internet are not representative" applies.

You should get in touch with the Ferrous folks, I'm sure they'd love to hear from you.

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

#55

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…

Why use floats when you can basically have doubles for the same cost? Floats tend to cause nasty surprises when you deal with real world units.

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

#56

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

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?

Really just depends on what you wanted to specialize in. My degree is basically the VLSI portion of an Electrical Engineer and Operating Systems portion of a CS degree. There were many students in my HDL classes that were purely CS but had an interest in software based processors. Not as many EE's taking classes on Big-O notation.

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

#58
post #55

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…

Why use floats when you can basically have doubles for the same cost? Floats tend to cause nasty surprises when you deal with real world units.

Good point. The class definitions can easily be changed from float to double in just a few lines.

I used to use a lot of doubles. The I wrote some DirectX and GPUs all use float. I figured if floats are good enough for 3D, they're good enough for me :o)

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

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

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 work in embedded and like to ask people offering courses / tooling / services around safety if they support Rust and the only answer I got so far is "no". A lot of those people either don't know about Rust or they don't care, because everyone's using C and C++.

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

#60
post #20

Earlier quoted context omitted.

There's some non-DOD avionics floating around that are ADA, I guess because of requirements and regulatory overlaps. http://archive.adaic.com/projects/atwork/boeing.html

I've read that SpaceX uses C++. I'm surprised safety critical systems like SpaceX and Tesla don't use Ada. It's a mature safe language used in their industry, yet they choose C++. From SpaceX's 2013 Reddit AMA: https://www.reddit.com/r/IAmA/comments/1853ap/we_are_spacex_...

I don't have any experience on this field, but researching the subject some time ago I found that C/C++ is not unusual too. On the safety matter, when used in critical mission systems they usually follow a guideline or framework to ensure the reliability of the software, like MISRA C[0] for exemple. Another important point is that the development is real slow compared to other segments of software engineering and often takes several years to develop, with lots of tests and rigorous compliance with specifications.

Its an interesting field, but feels hard to get into.

[0] https://en.wikipedia.org/wiki/MISRA_C

Post reply on HN