It used to be hampered down by confusing licenses but around 2021 those constraints were lifted when Adacore's "GNAT Community Edition" was retired. This was around the time Alire (works similar to if you combined Rustup with Cargo) came on the scene which meant getting the FSF version of the compiler was as trivial as running "alr toolchain --select".
The most recent standard came out in 2022 along with a more centered community. Most of the ada community was living in a newsgroup (comp.lang.ada) until a year ago, and now ada-lang.io is gaining a lot of traction.
Then Alire 2.0 just recently came out which made everything even more streamlined.
Ada has been my favorite language for years, so I'm happy to see more people noticing it.
Great to know that's no longer the experience with Ada, I might finally get it and try to start a project using it.
Why one would use Ada now when it looks like there are much stronger contenders in this space: rust for close to metal and C#, Java, Go for slower programs?
Off the top of my head, Ada has "restricted types" (e.g: you can say a function takes an integer of the range 5-15 only), as well as pre-and-post conditions you can annotate your procedure definition with.
From what I have read, trying to do something like "type Element is Integer range 100 .. 1000;" in rust requires something along the lines of
struct BoundedU16<const MIN: u16, const MAX: u16>(u16);
impl<const MIN: u16, const MAX: u16> BoundedU16<MIN, MAX> {
pub const fn new(value: u16) -> Result<Self, BoundError> {
if value >= MIN && value <= MAX {
Ok(Self(value))
} else {
Err(BoundError(value, MIN, MAX))
}
}
}On the other hand: these types make life hard. Kind of like Rust's lifetimes. Sometimes obviously correct code doesn't compile and you need to twist and tie yourself into knots in order to get a much more convoluted version to compile. Well, like Rust.
They are indeed very similar, and require approximately the same level of pain tolerance.
Sorry, can you elaborate on this? Rust was also designed to be close to the metal, so I'm assuming that there's some concrete difference that you're referring to.
> Ada has also been demonstrated to be more cost effective over a programs lifetime than C, C++ and Java.
Do you have a citation for this improved cost-effectiveness? Things like that are notoriously difficult to prove, so I'd be curious to know how this was measured.
Representation clauses are just beautiful for embedded memory-mapped registers and network protocols and driver registers received over spi/i2c etc.. There is even built-in validity checking. No need to shift generally as the compiler does everything for you.
https://learn.adacore.com/courses/Ada_For_The_Embedded_C_Dev...
The D.O.D study that includes Java would need to be dug up but this one is interesting too.
https://forum.ada-lang.io/t/comparing-the-development-costs-...
I only found out recently that the D.O.D. Ada mandate didn't say you had to use Ada. It said you had to demonstrate why your project would be more cost-effective than using Ada. Considering Ada was designed with cost-effectiveness/maintainability as a primary requirement then that was a difficult task.
Define stronger? C#, Go, Java probably by wide use in enterprise/industry, but Rust? Power of sunshine and rainbows? Wishful thinking?
adaptation, active community, more modern features, larger ecosystem
If you have to use dynamic allocation, you could also use the built in container libraries or controlled types for additional safety.
Though if you want the kind of memory safety that Rust has, there's always SPARK (a subset of Ada).
You can install gnatprove with alire via "alr install gnatprove"
I still preferred frama-c, because C, but it's a really nice toolchain.