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: over 450 different programming languages 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 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 (France), Red (UK), Blue (IBM), Yellow (SofTech)
- Winner Selected - Green proposal by Jean Ichbiah’s team at CII Honeywell Bull
- Named After Ada Lovelace - 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 being 45+ years old, 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, Mars rovers
- 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 caught the Mars Climate Orbiter bug that would have been prevented in Ada - mixing metric and imperial units caused a $327 million spacecraft to burn up.
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 included in standard GCC distributions, 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) - 10,000 lines of SPARK proven to have zero runtime errors.
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) - 500,000+ lines of Ada managing European airspace, processing 30,000 flights daily with zero unplanned outages over years.
Canadian Air Navigation System - Replaced 1960s-era system with Ada-based solution, reducing operational costs by 40% while improving safety.
Boeing 787 Dreamliner - Common Core System uses Ada for aircraft health monitoring and flight controls.
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 entirely in Ada, processing millions of lines of safety-critical code.
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
Fully automated driverless metro system operates with Ada-based control software.
Airbus A380
Avionics and flight management systems 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 gcc:latestExample usage:
docker run --rm -v $(pwd):/app -w /app gcc:latest sh -c 'gnatmake hello.adb && ./hello'