Live data from Hacker News

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

hackaday.com

151–160 of 330 posts

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

#151

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

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

I keep thinking servers should be written a bit more like embedded thingies. (Though I suspect the actual trend is in the other direction).

Both kinds of software deeply interested an asynchrony and concurrency (though not necessarily parallelism). And both also tend to talk over networks to other gadgets as part of a complex system. And since my job often revolves around putting out fires when severs OOM, I'd also like to see a lot less malloc().

It would be nice if software could place hard upper limits on how many resources (including RAM) it takes to serve a request and then reject requests early. With real-world languages and frameworks, we can only do very primitive approximations to this. But a framework written from the bottom-up with a malloc-is-evil mentality () might be able to do it.

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

#152
post #138

Earlier quoted context omitted.

If big binary works faster, I would prefer big binary any day. Nobody cares about disk size.

>Nobody cares about disk size. Embedded people care.

To be fair, “embedded people” do not use disks.

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

#153

Earlier quoted context omitted.

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

> The two languages, ecosystems, and communities seem to have largely non-overlapping objectives despite having overlapping technical capabilities. I keep thinking servers should be written a bit more like embedded thingies. (Though I suspect the actual trend is in the other direction). Both kinds of software deeply interested an asynchrony and concurrency (though not necessarily parallelism). And both also tend to t…

hmm... there are many libraries that are no-alloc. It seems quite feasible (well, that and custom allocators are a thing now)..

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

#154
post #113
post #94

Earlier quoted context omitted.

> ore attention provided to things like Wasm than there is to things like embedded use cases for example. Things might be better, but last time I checked rust's compiler was a lot slower than C and the binaries were several times bigger. That last one is a big deal for embedded.

Another consideration: Rust’s compiler is also slower because it does a lot more forces you to add error handling. In terms of real impact on developers I never felt it was dramatic. The rust language support in editors is so good that you will catch most errors before compiling. So once everything is dealt with you usually compile and it just works. Binary size is also one of these areas they are dealing with atm.

It's also slower because it hands LLVM a boat-load of IR and relies on LLVM to optimize it (instead of doing it itself).

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

#155
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 recent Boeing debacle was a systems engineering issue. AFAIU, there was a jammed sensor, and the systems corrected based on incorrect input from this sensor. Additionally, it is my understanding that some indicator that showed that these sensors disagreed with each other was not always present.

Regardless, this entire incident was precipitated by boeing, and the carriers, not wanting to have to retrain pilots on the new systems.

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

#156
post #141

Earlier quoted context omitted.

If big binary works faster, I would prefer big binary any day. Nobody cares about disk size.

And for most compilers, changing whether you care about binary size or performance, is a single switch away, not a series of enhancements you need to refer to a blog page to ensure you're doing it right.

Rust does have the same switches C compilers have, that do the same things.

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

#157

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.

The point is to demonstrate what's inherently overhead and what isn't. Rust has effectively the exact same inherent overhead as C does; that's the point.

> Nobody wants to play with their compiler to get a small binary... If rust can produce small binaries, then it must produce small binaries.

Everything is a tradeoff. Smaller binaries may or may not perform better than larger ones. This is something you need to play with, just like in C. If one single setting made everything the best in all circumstances, it wouldn't be a setting. C compilers have these settings too.

> Languages are typically judged by their defaults.

As I mentioned, the defaults have also been adjusted to help out too.

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

#158
post #132
post #125

Earlier quoted context omitted.

Only a person who has never worked on a safety-critical application would say something ignorant like that. (I am neither a Rust nor an Ada user.)

I have actually worked on safety-critical applications. ISO 26262, MISRA C, ASIL, etc. :D . I even own and drive a car that has my software in it. I am obviously teasing the OP, but there's IMO a lot of truth to it. Safety-critical stuff damn better be simpler, smaller and fundamentally easier or it will fail and kill people. That's why stuff like https://groups.google.com/forum/message/raw?msg=comp.lang.ad... makes…

I think well designed safety critical bare-metal stuff and well designed browsers have a difference in complexity placement - within bare-metal work you need to be aware of and account for the full domain range of values any systems you talk to can produce (including error output) and account for those - while browsers[1] tend to be more emergently complex with relatively secure and safe input but a lot of complexity in how those inputs are handled.

One system is taking a complex world and trying to reduce it to a safe and simple system - the other is taking something safe (some rando user inputs and a pile of HTML) and turning it into something complex - a rendered website.

Granted, I think value domain identification is one of the only ways for complex software to at all survive growing into a legacy system - so maybe the core difference is the nice stress free life of a system where the worst outcome of a critical failure is someone not being able to post on facebook ;P

1. Lets ignore firefox and JS and just assume we're in the 90's downloading HTML sites...

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

#159

Earlier quoted context omitted.

fortran with nice syntax and built in bit operations.

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.

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

#160

Earlier quoted context omitted.

How? Ada was designed for programming safety-critical, military-grade embedded systems. Rust was designed as a memory-safe, concurrency-safe programming language, largely to overcome the shortcomings of C++. Each excels at what it was designed for, but the intended use cases are very different. Rust is not (currently) being used for aircraft flight control systems--Ada is. Ada is not (currently) being used for high-p…

Those are good points. While I can see rust flying within the next few years, I dont see it in flight controls for a while yet. That said I'm aware of c++ flight control software which seems insane. And that seems to be the trend. Rust does target embedded so there is no reason not to try and move it in that direction, though ada seems a much better choice.

Agreed. The PicoRV32 mentioned in the article's "WHERE TO GO FROM HERE" section has its own crate: https://docs.rs/picorv32/0.1.3/picorv32/

C/C++ have been great for embedded work, but Ada and Rust are better alternatives in my opinion. They are safer, more powerful, and more secure.

Post reply on HN