**coltonlewis.name: Ada Is Underrated [Org] All L1 (Kernel Hacker Mode) ---

Ada Is Underrated

Bad Reputation

This history is a summary from the Wikipedia page.

In the 1970s, the Department of Defense was concerned about the explosion of programming languages used for government contracts. Many were hardware dependent and quickly became obsolete. To combat this, they created the Higher Order Language Working Group to survey existing languages to determine which one should be the standard for DoD projects. The working group wrote down what they wanted in a language in a series of documents known as the Steelman Language Requirements. They wanted a language that emphasized reliability, maintainability, and efficiency while including support for exception handling, run-time checks, and parallel computing.

They concluded no existing language fit their criteria and created a contest for a newly designed language. The language that won came to be known as Ada. While Ada enjoyed a brief time in the spotlight as the language of the future, programmers quickly turned against it due to its unfamiliar features and difficult compiler implementations.

These problems were blamed on the inherent complexity of the language and Ada's reputation was stamped into history as a warning against complex languages and design by committee. However, I believe Ada was a great language ahead of its time and is now making a much deserved comeback with Rust sparking a renewed interest in safe languages.

Strengths

Ada has many strengths. Though modern programming language ecosystems have caught up in some respects, Ada still boasts many impressive features for a language designed to support low-level embedded programming. Its only real competitors in that space are C++ and Rust, and it beats them and other languages in several aspects.

  1. Exceptions
  2. Objects
  3. Generics
  4. Performance
  5. Modules
  6. Build System
  7. Strong Typing
  8. Comprehensive Documentation
  9. Language-Level Concurrency
  10. Formal Verification via SPARK

Exceptions, objects, and generics are hardly notable given that they've been popularized across a broad number of languages. C++ has all that. Rust has turned away from exceptions but still boasts excellent error handling.

Ada's performance is competitive with C++ and Rust. The only languages regularly faster are too low level to include the other features on this list such as C and FORTRAN.

Ada has an easy to understand package system which C++ lacks, but keeps things simpler than Rust by keeping the file as a compilation unit while rust as a many-to-many mapping between modules and files.

Ada has two commonly used build systems. GPRBuild is older and still superior to make or cmake which builds most C++ projects. More recent Ada projects use Alire which matches Rust's Cargo by downloading dependency packages from an online repository when required. Ada regularly has faster build times than either C++ or Rust.

Ada's type system is where the real differentiation begins. It stands out in allowing range-limited types. As a simple example, the type system allows you to specify positive numbers. Neither C++ nor Rust allow that. It's also easy to define arrays using the range-limited types as the index, which makes out-of-bounds conditions impossible.

The documentation is another differentiator. Ada is fully defined by the Ada Reference Manual, which is the ground truth for the language specification while still being readable to the working programmer. This manual is freely available while C++'s spec is pay-walled and Rust has no formal spec.

Ada supports the concept of tasks with keywords in the language that is automatically compiled and mapped to threads and processes on the host system. C++ and Rust offload concurrency to thread libraries with all the pitfalls of that.

Finally, Ada goes much further than other languages in its support of formal verification. A strict subset of Ada called SPARK supports theorem proving. Even outside this subset, pre- and post-conditions may be applied to any procedure.

Criticisms

Complexity

Maybe Ada was complex in the 80s when it was introduced, but reading Ada in comparison to modern C++ or Rust paints it as a simpler alternative to either of them.

Bad Syntax

Modern languages almost universally use C-like syntax with lots of symbols and brackets. Ada takes its cues from Pascal linage instead and uses more English keywords. There is nothing wrong with this. It is easier to read and more comfortable to write. I can type out "end" about as fast as "}". It's only two key presses instead of three and uses more dominant fingers. Aside from that, Ada's syntax is specifically designed to avoid accidental copy/paste mistakes.

Dead Language

It's supported by GNAT, a part of GCC and the most common compiler in the world. It has an actively developed standard. It is climbing in the TIOBE language popularity index following the popularity of Rust. And NVDIA recently partnered with with AdaCore to use Ada for some of their safety-critical firmware.

While there may not be a ton of libraries in existence, there is a lot of proprietary code out there since the 80s and I believe the talent pool is probably surprisingly deep.

Conclusion

I believe Ada is a good language that deserves more attention.