Why do you keep using Ada?

Hey everyone! I’ve been using Ada for over a month now and I’ve been really enjoying and I wanted to connect more with the Ada community so I wanted to ask. How long have YOU been using Ada and what do you like about? I’m curious what people who have been using it way longer than me have to say about this awesome (and VERY underrated) language.

I wrote avionics software for two helicopters in a big team.
Later I ported the original avionics (big endian, Ada 83) to a new compiler of a different vendor on different hardware (little endian, up to Ada 2012) for a real time flight training simulator. It was amazing how fast this was.

Disclaimer, I am not a professional programmer.

  1. Because it is fun to do things with it. I do not write code so that I can write code. I write code to do fun stuff and Ada just gets out of the way. Other languages are complex, require me to reason quite heavily, force me to think in the language-space rather than in my-problem-space.
  2. Because it is brutally easy to debug. I once found a stupid error in a library (un-initialised variable) in a matter of 20 mins. This is huge. The library was several thousands of lines of code I had never seen. I only had to give it input and it gave me outputs. But with a specific, correct input, it crashed. I found the offending line in 15 mins thanks to Ada’s check and arithmetic. Had it been any other language, it would have produced a garbage output and I would not have noticed it until several hours or days into my project (the output was not meant to be read by humans, it was automatically generated code).
  3. Because it made me learn a lot. I learnt more about low level code with Ada than C. I learnt more about types than any other languages.
  4. Because the community is super cool and knowledgeable.
  5. Because it is rock solid and well designed.
  6. Because it has features other langs can only dream about, such as type predicates, contracts and SPARK

I hope this answers your question ^^

I don’t get to use Ada in my professional life as much (most things are done in C, but I try to sneak in some Ada when I can), so most of my Ada use these days is fun stuff at home.

For me it’s just a fun language. I like most things about it (there’s definitely some pain points for me, but they are minor), but I like how a well constructed package looks and feels. I like the type system, how enums are utilized, and the unique tasking system among other things.

This is my personal list of why I learned the language in 2021ish and keep coming back to the language.

  • Simple rules, clear syntax (easy to learn, and I’ve come back years later to a project and was able to pick it right up again)
  • Ranges on types ('first, 'last, 'pred, 'succ, 'range)
  • Super-powered enums ('first, ‘last’, 'pred, 'succ, 'value, 'image). Built-in to-string and parsing of enums, and you can use them as array indices.
  • Pre/post conditions
  • Package instead of class-level encapsulation. Packages cut up subproblems at the domain level, not at some arbitrary software architecture level, so I get fewer getters/setters in tightly related code, fewer “God classes”, and keeping related types/functions together prevents ravioli code.
  • Spec/implementation separation emphasizes “Why am I writing this?”. Specs prevent the need to code fold and combines the public interface of a module and makes it explicit.
  • Good low level control (bit representation, compiler intrinsics, ASM, easy import from C)
  • Ease of creating semantically different primitives (e.g. type Foo is new Integer). Helps with units and preventing data from flowing between systems without being cleaned.
  • Named parameters and aggregates
  • Access types and aliased make “pointer” semantics much more direct
  • Operator overloading when I want it (i.e. math code)
  • Explicit generics show the cost and slow down “generify all of the things” you see in other languages
  • Scope-based types (controlled types) for auto cleanup
  • Alire (95% of the time, I don’t need to mess with the build)
  • SPARK (opt-in verification)
  • Mostly easy-to-use standard library
  • Environment startup task lets you explicitly control system startup before the program enters the entry point.

tldr;

Ada makes it easy to write the right thing the first time, even for low level code.

We can enumerate the many benefits all we want, but I think it all boils down to
Ada simply being an excellent tool of engineering.

Because I’m a masochist. It takes me 3-5 times longer to write and debug an Ada program as it does C++/Fortran/Python/Java/C#/TCL/VBA. Sometimes, one syntax error can get me bogged down for half a day. Basically, I haven’t rearranged the problem in my design to do it the Ada way. I’m still in C++/Python mode.

I keep using it because I’d like to think Ada and speed up the development time instead of thinking in another language and then translating and having to rethink the problem and recode it the Ada way. It gets easier once I’ve worked out the whys and the hows.

I like Ada because it supports the way I think as a software engineer.

I think all software should be correct. I use Ada because it is the best language for creating software that is correct, as shown by its long record of use in domains where the software must be correct.

My experience is that creating correct software with Ada takes less effort than creating incorrect software in other languages.

My experience is that creating correct software with Ada takes less effort than creating incorrect software in other languages.

I feel the same. Strongly and stactical typed language makes it harder to have a program which compiles… but once it compiles, it is often OK.

Because it’s the best language, better than C and Rust for embedded, better than Go for memory control and language design quality and reliability (Go shines at throwing people into short projects). Better than Rust at basically everything (I’m only not sure about concurrency performance but certainly concurrency safety on a standard runtime). I’m also now invested somewhat and whilst Zig looks interesting, I haven’t actually investigated and I doubt it comes even close to what Ada SPARK offers.

I do a lot of embedded development, from real time industrial devices to 8-bit microcontrollers. It’s the only language (outside of Forth on MCUs) that I don’t have to convince it that I want to do low level embedded stuff.
And the tasking capabilities, warts et al, are still heads above any other programming languages.

Welcome to the forum @tcoram!

And excellently engineered. It may have done some things differently with hind sight or maybe just today (UTF-8 dominance) but the language is all exhaustively well considered and engineered, which is rare and perhaps unique.

I believe Dewar called it a “real marvel of engineering”.

They set out to create the best language ever deserving to replace all other languages. Personally I think they achieved it. I guess the fact that the D.O.D. isn’t saving as much money from using Ada as they should be is largely a social problem and not a technical one. Perhaps the NSA didn’t actually want everyone to use a secure language too like they didn’t want people using cryptography (Bernstein vs United States) :wink:.

Disclaimer: I am not a programmer, but I do research in signal processing. I code to implement and check the DSP algorithms that I develop. As I like to say, to me programming is a tool, not a job.

Said that…

I discovered Ada many years ago because of an article on a PC magazine. Since then, it is my preferred language for general purpose and long lived software (for numerical software, I use Octave-Matlab, for fast-and-dirty stuff I use Ruby).

Why do I keep using Ada? Because if you help the compiler helping you, it is pretty easy to write software robust and easy to maintain. I love all the bug traps that the language provides you such as contracts and type invariants. I also like how easy it is to organize the software packages and the fine control you have on the visibility of different parts of the code.

Let me give you an example. Several years ago I wrote a program to help me in writing European project proposal. It accepts a “high level” and rigid description of the project (the WPs, the tasks, dependencies, milestones, deliverables, …) and it produces all the stuff that goes at the end of the proposal (WP & Task description, milestone & deliverable tables, GANTT, …).

At first the model for a deliverable was that it was something with a description, a delivery date and other stuff. Successively I discovered that you can have “periodic deliverables,” for example, periodic reports about the project. Sure, you can duplicate the deliverables by hand, but it is error prone; better having the concept of “periodic deliverable.”

Unfortunately, the hypothesis that deliverables had a single delivery date had deep roots in the code and adding periodic deliverables required changing maybe 30% of the code. I expected a long and painful bloodbath, but… it took just an afternoon. As soon as the compiler was happy with my code, I got the new project generator with periodic deliverable. Quite a smooth experience.

I also only recently started using Ada; I wanted something that was well designed, easy-ish to parse (both mechanically and mentally), and provided me the tools I’d like for proving out capabilities of my code.

I’ve been curious about Ada for decades now, ever since seeing it in a “computer dictionary” as a kid in the 90’s, or playing with SparForte when it was first being released years later. With the Rise of LLMs, I wanted something that felt like I could wrestle with my code more, and not always have to rely on fancy compilers like I would with e.g. OxCaml or OCaml. I also feel like it was much easier to get started with than other languages when you got into more complex topics; few things feel bolted on or jarring when you learn about how they’re implemented in Ada. Overall it’s been really pleasant learning, much more so than I would have originally expected

I started using Ada myself recently. I like that the compiler is no frills and one can check more stuff with gnatprove and SPARK. Alire is very nice and using it has been great. The language itself sometimes even feels better than something like Rust to me.

Like the previous reply, I have been curious about Ada for a while now. Currently implementing a library and learning as I go, granted I do use some AI assistance with my code.

This is going to sound weird, but because Ada is a “clean” language both in terms of organization (although I Do have gripes with the string libraries), and in terms of compiler warnings/errors. I feel like when I code in a language like Swift/Nim, especially when trying to glue C myself that these languages make it harder to use FFI, not easier. Especially Swift, by god I hate clang modules and shims.

I also have a thing against Rust. If anyone wants to talk to me about the greatest source of friction of making new programmers is Rust (and Swift) make standard library exploration + type extension more difficult then it needs to be. I think Rust and standard libraries of the modern day put too many methods/operations on the type and not the global package. I hate that because generally if you compose new types and/or use overloads, you can easily get a non-local bug.

Luckily, I rarely get that with Ada. As someone who “discovered a gnat bug” somehow (probably was my fault anyway), Ada is the most approachable C language FFI glue I Have tried. Close second would be Odin maybe, but Odin also comes with batteries included so I havent tried by hand. Close second as in “I tried that by hand” was D. But D also have a GC and when given the choice between it and Ada, I chose Ada.

D still has a really nice language though. But yeah, Ada is my ideal glue + fluent service language. That is rare.

Honestly my only gripe is that the language has a pecuiliar, hard to adjust generic model. I am faceplanting hard on having fun with it but trying to map it to common domains/proxies. Well that and Strings are painful. But they were painful in C too lol.

I wrote up a paper Explaining Ada’s Generics, which might help you there.
As to strings, they’re actually pretty easy once you get that there’s purposes behind them:

  • String: An array of characters, constant length; behaves exactly like other arrays.
  • Bounded_String: Strings which have an explicit maximum size; maps directly into database Char(Length) fields.
  • Unbounded_String: The fully mutable string, w/o a set length.
  • Wide_Whatever: Uses a 16-bit character’s code-point.
  • Wide_Wide_Whatever: Uses a 32-bit character’s code-point; useful for directly representing & processing Unicode code-points.