Ada - ArchWiki

# Ada

From ArchWiki
Jump to navigation Jump to search

Ada is a general purpose, compiled programming language. It features strong static typing, packages, exceptions, generics, tasking, object-orientation and contracts.

## Installation

Install the gcc-ada package. This will install the GNAT compiler, which is an Ada front-end for the GNU Compiler Collection (GCC).

Additional packages:

- gprbuildAUR or gprbuild-gitAUR - GPRbuild build system
- xmladaAUR or xmlada-gitAUR - XML/Ada
- ada-web-serverAUR - Ada Web Server
- aunitAUR - Ada Unit Testing Framework
- GNATColl - GNAT Components Collection
  - gnatcoll-coreAUR or gnatcoll-core-gitAUR
  - gnatcoll-db2adaAUR
  - gnatcoll-gmpAUR or gnatcoll-gmp-gitAUR
  - gnatcoll-iconvAUR or gnatcoll-iconv-gitAUR
  - gnatcoll-postgresAUR
  - gnatcoll-pythonAUR
  - gnatcoll-readlineAUR
  - gnatcoll-sqlAUR
  - gnatcoll-sqliteAUR
  - gnatcoll-xrefAUR
- gtkadaAUR - Ada bindings for the Gtk+ library

### Test your installation

Check that GNAT is installed correctly by building a simple program, as follows:

    hello.adb

    with Ada.Text_IO;

    procedure Hello is
    begin
       Ada.Text_IO.Put_Line ("Hello, Arch!");
    end Hello;

You can compile it with `gnatmake`:

    $ gnatmake hello

    gcc -c hello.adb
    gnatbind -x hello.ali
    gnatlink hello.ali

Then run it:

    $ ./hello

    Hello, Arch!

## See also

### Language

- Rationale for Ada 2012
- Ada 2012 Language Reference Manual
- Ada Programming at Wikibooks
- Interactive learning platform Learn.adacore.com
- Wikipedia:SPARK (programming language)

### Tools

- GNAT User’s Guide for Native Platforms
- GNAT Reference Manual
- GPRbuild and GPR Companion Tools User’s Guide

### Library Docs

- XML/Ada: The Unicode and XML Library for Ada
- AWS: The Ada Web Server
- AUnit Cookbook
- GNAT Reusable Components
- GtkAda User’s Guide

Category:

- Programming languages