Ada
The safety-critical programming language designed for reliable, long-lived systems - from aerospace to medical devices and defense systems.
Created by Jean Ichbiah and the U.S. Department of Defense
Ada is a programming language designed from the ground up for safety, reliability, and long-term maintainability. Created for the U.S. Department of Defense to consolidate hundreds of incompatible programming languages used in embedded systems, Ada has become the gold standard for mission-critical software where failure is not an option.
History & Origins
In the 1970s, the U.S. Department of Defense faced a crisis: an estimated 450 or more programming languages and dialects were being used across various defense projects, creating maintenance nightmares and escalating costs. In 1975, the DoD formed the High Order Language Working Group to evaluate existing languages and, ultimately, to design a single modern programming language suitable for embedded systems.
The Competition
The DoD held an unprecedented international competition from 1977-1980:
- Initial Requirements - Published “Steelman” requirements document (1978)
- Four Finalists - Green (CII Honeywell Bull, France), Red (Intermetrics, USA), Blue (SofTech, USA), Yellow (SRI International, USA)
- Winner Selected - Green proposal by Jean Ichbiah’s team at CII Honeywell Bull
- Named After Ada Lovelace - Widely regarded as the first computer programmer (1815-1852)
Design Philosophy
Ada was designed with revolutionary principles for 1980:
- Safety First - Strong typing to catch errors at compile time
- Readability - Code should be maintainable for decades
- Modularity - Packages and separate compilation
- Concurrency - Built-in tasking for real-time systems
- Portability - Strict standardization across compilers
Why Ada Still Matters
Despite its origins in the early 1980s, Ada remains essential in critical industries:
1. Safety-Critical Systems
Ada dominates domains where failure costs lives:
- Aviation - Flight control, avionics, autopilot systems
- Space - Satellite control, launch vehicles
- Medical Devices - Pacemakers, radiation therapy machines
- Railway - Automatic train control, signaling systems
- Nuclear Power - Plant control and monitoring systems
2. Compile-Time Error Detection
Ada’s strong type system catches errors before runtime:
| |
This illustrates the kind of error behind the Mars Climate Orbiter loss - mixing metric and imperial units between separate software systems contributed to the approximately $125 million spacecraft burning up in 1999. Ada’s type system could help prevent such errors within a single codebase, though the Orbiter’s failure involved data exchange between independently developed systems.
3. Built-in Concurrency
Ada includes tasking as a core language feature:
| |
No external libraries needed - concurrency is language-level.
4. Contract-Based Programming
Ada 2012 introduced formal contracts:
| |
Preconditions and postconditions are checked at runtime, making Ada contracts executable specifications.
Modern Ada Features
Ada 2022 is far from its 1980s roots:
Object-Oriented Programming
| |
Generic Programming
| |
Modern Containers
| |
Parallel Iteration (Ada 2022)
| |
The Ada Compilation System
Ada uses a sophisticated compilation model:
Package Specification (.ads)
| |
Package Body (.adb)
| |
This separation enforces interface contracts and enables separate compilation.
The GNAT Compiler
GNU Ada (GNAT) is the most widely used Ada compiler:
| Feature | Details |
|---|---|
| License | GPL with runtime exception (commercial use OK) |
| Platforms | Linux, Windows, macOS, embedded systems |
| Standards | Ada 83, 95, 2005, 2012, 2022 |
| Backend | GCC (excellent optimization) |
| Integration | C/C++ interoperability, debugger support |
GNAT is part of the GCC project and available through most Linux package managers (e.g., apt install gnat), making Ada readily available.
Ada’s Unique Strengths
1. Range Types
| |
2. Enumeration Types
| |
3. Discriminated Records
| |
4. Exception Handling
| |
The SPARK Subset
SPARK is a formally verifiable subset of Ada:
- Mathematical proof of correctness
- Zero runtime errors guaranteed by static analysis
- Used in highest-criticality systems (aviation, nuclear, medical)
- Tools prove absence of: buffer overflows, null dereferences, arithmetic errors
Example: Tokeneer system (secure entry system commissioned by the NSA) - approximately 10,000 lines of SPARK formally verified to be free from runtime errors such as buffer overflows, range violations, and division by zero.
Getting Started
Ada source files use extensions:
.ads- Package specifications (interface).adb- Package bodies and programs (implementation)
Typical GNAT workflow:
| |
The gnatmake command handles dependencies automatically, compiling only what changed.
Ada in the Real World
Success Stories
Eurocontrol (European Air Traffic) - Mission-critical flight plan processing systems (ETFMS, IFPS) written in Ada, managing European airspace and processing approximately 30,000 flights daily.
Canadian Automated Air Traffic System (CAATS) - Approximately 1 million lines of Ada developed by Raytheon to modernize Canada’s air navigation infrastructure.
Boeing 787 Dreamliner - The Common Core System (CCS) platform, developed by Smiths Aerospace, uses Ada among its hosted applications for functions including aircraft health monitoring.
The Longevity Advantage
Ada codebases routinely last 30-40 years:
- Strong typing prevents breaking changes
- Packages enforce modularity
- Standardization ensures compiler compatibility
- Readability aids long-term maintenance
Programs written in Ada 83 (1983) still compile with modern Ada 2022 compilers - nearly 40 years of backwards compatibility.
Why Ada Isn’t Everywhere
If Ada is so great, why isn’t it more popular?
- Learning Curve - Strong typing and safety features require discipline
- Verbosity - More typing than Python or JavaScript
- Compilation Speed - Thorough checking takes time
- Ecosystem - Fewer libraries than mainstream languages
- Perception - Seen as “legacy” despite modern features
But where reliability matters more than rapid development, Ada excels.
Modern Ada Development
Contemporary Ada isn’t isolated:
- Alire - Modern package manager (like Cargo for Rust)
- GPRbuild - Advanced project build system
- Ada Language Server - VSCode and IDE integration
- AdaCore tooling - Commercial-grade static analysis
- C/C++ integration - Easy foreign function interface
- Cloud deployment - Ada microservices in containers
The Ada Community
Active resources for learning Ada:
- learn.adacore.com - Interactive Ada courses
- AdaCore University - Free training materials
- Ada-lang.io - Community hub
- Awesome Ada - Curated libraries and tools
- comp.lang.ada - Newsgroup (yes, it’s still active!)
Continue to the Hello World tutorial to write your first Ada program.
Timeline
Notable Uses & Legacy
Boeing 777
Primary flight control software written in approximately 99.9% Ada, with hundreds of developers working on the safety-critical codebase.
Ariane 5 Rocket
Launch vehicle control systems use Ada for its reliability in space applications.
Air Traffic Control
FAA and international air traffic control systems rely on Ada for managing aircraft separation and routing.
Paris Metro Line 14
The original METEOR automatic train control system (opened 1998) was built with Ada, operating reliably for approximately 20 years.
Airbus A380
Several avionics subsystems, including the braking/steering control unit and flight warning computer, reportedly leverage Ada's strong typing and safety features.
Military Systems
U.S. and allied defense systems including missile guidance, radar, and command-and-control use Ada extensively.
Language Influence
Influenced By
Influenced
Running Today
Run examples using the official Docker image:
docker pull codearchaeology/ada:latestExample usage:
docker run --rm -v $(pwd):/app -w /app codearchaeology/ada:latest sh -c 'gnatmake hello.adb && ./hello'