Est. 1980 Intermediate

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

Paradigm Multi-paradigm: Imperative, Object-Oriented, Concurrent, Distributed
Typing Static, Strong, Safe
First Appeared 1980
Latest Version Ada 2022

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:

  1. Initial Requirements - Published “Steelman” requirements document (1978)
  2. Four Finalists - Green (CII Honeywell Bull, France), Red (Intermetrics, USA), Blue (SofTech, USA), Yellow (SRI International, USA)
  3. Winner Selected - Green proposal by Jean Ichbiah’s team at CII Honeywell Bull
  4. Named After Ada Lovelace - Widely regarded as the first computer programmer (1815-1852)

Design Philosophy

Ada was designed with revolutionary principles for 1980:

  1. Safety First - Strong typing to catch errors at compile time
  2. Readability - Code should be maintainable for decades
  3. Modularity - Packages and separate compilation
  4. Concurrency - Built-in tasking for real-time systems
  5. 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:

1
2
3
4
5
6
7
8
9
-- Separate types prevent mixing incompatible values
type Meters is new Float;
type Feet is new Float;

Distance_M : Meters := 100.0;
Distance_F : Feet := 328.0;

-- Compiler error: can't add meters and feet
Total := Distance_M + Distance_F;  -- Won't compile!

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:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
task type Worker is
    entry Start;
    entry Stop;
end Worker;

task body Worker is
begin
    accept Start;
    -- Do work
    accept Stop;
end Worker;

No external libraries needed - concurrency is language-level.

4. Contract-Based Programming

Ada 2012 introduced formal contracts:

1
2
3
procedure Withdraw (Amount : Money)
    with Pre  => Amount > 0.0 and Amount <= Balance,
         Post => Balance = Balance'Old - Amount;

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

1
2
3
4
5
6
7
8
9
type Shape is abstract tagged record
    X, Y : Float;
end record;

type Circle is new Shape with record
    Radius : Float;
end record;

overriding function Area (C : Circle) return Float;

Generic Programming

1
2
3
4
5
6
generic
    type Item is private;
package Stack is
    procedure Push (I : Item);
    function Pop return Item;
end Stack;

Modern Containers

1
2
3
4
5
with Ada.Containers.Vectors;

package Integer_Vectors is new Ada.Containers.Vectors
    (Index_Type   => Natural,
     Element_Type => Integer);

Parallel Iteration (Ada 2022)

1
2
3
for Element of Array_Data parallel loop
    Process (Element);
end loop;

The Ada Compilation System

Ada uses a sophisticated compilation model:

Package Specification (.ads)

1
2
3
4
package Calculator is
    function Add (X, Y : Integer) return Integer;
    function Subtract (X, Y : Integer) return Integer;
end Calculator;

Package Body (.adb)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
package body Calculator is
    function Add (X, Y : Integer) return Integer is
    begin
        return X + Y;
    end Add;

    function Subtract (X, Y : Integer) return Integer is
    begin
        return X - Y;
    end Subtract;
end Calculator;

This separation enforces interface contracts and enables separate compilation.

The GNAT Compiler

GNU Ada (GNAT) is the most widely used Ada compiler:

FeatureDetails
LicenseGPL with runtime exception (commercial use OK)
PlatformsLinux, Windows, macOS, embedded systems
StandardsAda 83, 95, 2005, 2012, 2022
BackendGCC (excellent optimization)
IntegrationC/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

1
2
3
4
type Percentage is range 0 .. 100;
type Day_Of_Month is range 1 .. 31;

Score : Percentage := 150;  -- Compile error!

2. Enumeration Types

1
2
3
4
type Traffic_Light is (Red, Yellow, Green);
for Traffic_Light use (Red => 0, Yellow => 1, Green => 2);

Current : Traffic_Light := Red;

3. Discriminated Records

1
2
3
4
5
6
7
type Vehicle (Has_Engine : Boolean) is record
    License_Plate : String (1 .. 7);
    case Has_Engine is
        when True  => Engine_Size : Float;
        when False => null;
    end case;
end record;

4. Exception Handling

1
2
3
4
5
6
7
8
begin
    Open_File (Name => "data.txt");
exception
    when Name_Error =>
        Put_Line ("File not found");
    when others =>
        Put_Line ("Unknown error");
end;

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:

1
2
3
4
5
# Compile and bind
gnatmake hello.adb

# Run
./hello

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?

  1. Learning Curve - Strong typing and safety features require discipline
  2. Verbosity - More typing than Python or JavaScript
  3. Compilation Speed - Thorough checking takes time
  4. Ecosystem - Fewer libraries than mainstream languages
  5. 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

1977
U.S. Department of Defense initiates language design competition after HOLWG (formed 1975) determined no existing language met requirements
1980
Ada language design (selected 1979 from four finalists) approved as MIL-STD-1815, named after Ada Lovelace
1983
Ada 83 becomes ANSI/MIL-STD-1815A standard
1987
Ada becomes ISO 8652 international standard
1995
Ada 95 adds object-oriented features, becomes ISO/IEC 8652:1995
2005
Ada 2005 enhances interfaces, real-time systems, and containers
2012
Ada 2012 adds contract-based programming and multicore support
2022
Ada 2022 introduces parallel iteration and new container features

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

Eiffel Spark VHDL C++

Running Today

Run examples using the official Docker image:

docker pull codearchaeology/ada:latest

Example usage:

docker run --rm -v $(pwd):/app -w /app codearchaeology/ada:latest sh -c 'gnatmake hello.adb && ./hello'

Topics Covered

Last updated: