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: 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:

  1. Initial Requirements - Published “Steelman” requirements document (1978)
  2. Four Finalists - Green (France), Red (UK), Blue (IBM), Yellow (SofTech)
  3. Winner Selected - Green proposal by Jean Ichbiah’s team at CII Honeywell Bull
  4. Named After Ada Lovelace - 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 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:

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 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:

 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 included in standard GCC distributions, 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) - 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:

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) - 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?

  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 competition for a common language
1980
Ada language design selected from four finalists, 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 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

Pascal ALGOL 68 Simula

Influenced

Eiffel Spark VHDL C++

Running Today

Run examples using the official Docker image:

docker pull gcc:latest

Example usage:

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

Topics Covered

Last updated: