Questions tagged [ada]

Ada is a structured, statically typed, imperative, wide-spectrum, and object-oriented high-level computer programming language, extended from Pascal and other languages.

Ada is a structured, statically typed, imperative, wide-spectrum, and object-oriented high-level computer programming language, extended from Pascal and other languages.Wikipedia

New to Ada?

Welcome! For learning any language, starting off with a good book is highly recommended. Ada is no different. Ada is different however in the number and quality of online resources available for free. A good starting point is the list of Ada Books On-Line. Once you have some basic learning under your belt, many find Ada LRM to be all the reference they ever need. The Ada Information Clearinghouse also provides a lot of useful links for learning Ada.

If you are looking for a good compiler, GNAT is a production-quality GCC-based Ada compiler that is freely available for Windows, OS X, and Linux; more here. Support and more platforms are available from AdaCore. If you want a more Windows-native compiler, Aonix ObjectAda uses the Microsoft linker, so it can be easier to use in an integrated Windows environment.

Versions

There are multiple versions of the language, named based on the year the ISO standardized the language. Thus there currently are Ada83, Ada95, Ada2005 and Ada2012. Any of those can be referenced as Ada, although the term is more appropriate for the latest version of the language.

Have a question?

When you ask a question, be sure to include any relevant source code. Try to keep the code as minimalist as possible while still reproducing the problem; often the problem will be found during the process. If there are any compiler errors, be sure to indicate:

  • Which compiler you are using?
  • Exactly what errors are shown?
  • On which lines do they occur (mark the lines with comment)?

It is recommended to enable syntax highlighting in the source code that you add to the question. Use the following syntax:

``` lang-ada
-- Ada source code goes here
```

External FAQs

Other External Resources

2354 questions
10
votes
6 answers

Is there a way to format text output in Ada

Is there a way to format the string being outputted? I'm trying get a pretty view of the following output 1: Ashley | 01033438392 | Wellington, New Zealand | 1987- 4-14 2: Aloha | 01087651234 | Hawaii, United States of America | 1988- 9-23 3: Jack…
Chang Hyun Park
  • 521
  • 1
  • 6
  • 22
10
votes
2 answers

Ada-like types in Nimrod

today I did ask in D mailing list whether it's possible to define and use custom data types in a way similar to e.g. example from Ada's wiki page: type Day_type is range 1 .. 31; type Month_type is range 1 .. 12; type Year_type is range…
gour
  • 967
  • 9
  • 22
10
votes
3 answers

Programming Arduino with Ada

I am am unable to get avr-elf-windows and WinAVR to work. I have managed to build the example supplied with avr-elf-windows (ATmega2560). But if I try and expand to use another chip or start using the WinAVR supplied packages and projects I keep…
Sean
  • 145
  • 1
  • 8
10
votes
3 answers

Gnat for Mac Ada programming

I'm learning Ada 95 in my programming class, and I would like to install the gnat compiler on my MacBook. I have no clue as to where to get a good gnat to compile my code, and how to install it. I currently have gedit as my text editor, because…
Derpboom
  • 211
  • 2
  • 3
  • 6
10
votes
3 answers

Command line arguments for Ada

I'm writing an Ada program that is supposed to do case conversion for alphabetic characters. The program uses 1, 2 or 3 command line arguments. I pretty much have the thing written up, but I have no clue as to how to how to do arguments. the command…
Derpboom
  • 211
  • 2
  • 3
  • 6
10
votes
2 answers

dynamic array size determined at runtime in ada

Is it possible to have an array with size that is determined at runtime like so, Procedure prog is type myArray is array(Integer range <>) of Float; arraySize : Integer := 0; theArray : myArray(0..arraySize); Begin -- Get Array size from…
Shelby115
  • 2,816
  • 3
  • 36
  • 52
10
votes
4 answers

Get Ada (compiled with GNAT) to import files from outside current directory?

I'm doing an intro to programming course at university, and the language of choice is Ada. I'm coding in Kate and compiling with GNAT 4.6.3. We have to use teacher-provided libraries for our programs, like so: with foo; use foo; Of course, then…
Jack M
  • 4,769
  • 6
  • 43
  • 67
10
votes
2 answers

Ada to C++: Pass an unsigned 64-bit value

I need to pass 2 pieces of data from an Ada program to some C++ code for processing. Data - double. Time - unsigned 64 bits. I was able to make a procedure in Ada that worked with my C++ method using a Long_Float (double in C++) and Integer (int…
Xeelot
  • 101
  • 1
  • 3
9
votes
2 answers

How can you check if an element belongs to one subtype or another?

I just learnt about Enums and Types in Ada and decided to write a small program to practice: with Ada.Text_IO; use Ada.Text_IO; with Ada.Integer_Text_IO; use Ada.Integer_Text_IO; procedure Day is type…
W.K.S
  • 9,787
  • 15
  • 75
  • 122
9
votes
4 answers

About "range" in Ada

The following source code line in Ada, type Airplane_ID is range 1..10; , can be written as type Airplane_ID is range 1..x; , where x is a variable? I ask this because I want to know if the value of x can be modified, for example through text…
J. C. M. H.
  • 159
  • 1
  • 9
9
votes
4 answers

Ada multitasking RTOS supported with opensource cross-compilers

Which RTOSes do Ada have opensource/free cross-compilers available, with support for multitasking/multithreading? I have an Atmel AT90USB162 chip which I want to program using Ada. My first option was to use AVR-Ada for programming it, but since it…
Rego
  • 1,118
  • 1
  • 18
  • 40
9
votes
4 answers

Operating system in Ada

I wonder if anyone know any simple design, but a very simple operating system written in Ada Or if possible, give an example, thank you.
Alexandre
  • 1,985
  • 5
  • 30
  • 55
9
votes
2 answers

Is it possible to define a numeric range for a field in Protocol Buffer?

I live in a very safety/critical Ada-ic environment, and have taken the habit of having well defined and bounded type definition. I am also confronted to lots ASN1 usage/evangelists. One of the key features that some people around me define as…
LoneWanderer
  • 3,058
  • 1
  • 23
  • 41
9
votes
1 answer

Building GNATCOLL in an Alpine Linux Docker Container

I can't seem to get GNATCOLL to compile in an Alpine Linux based Docker Container. My container so far is: FROM alpine:edge # Add extra repositories RUN echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories; \ echo…
LambdaBeta
  • 1,479
  • 1
  • 13
  • 25
9
votes
1 answer

print floats in ada

I want to print a float number, i am using the package FLOAT_IO. Is there a way to control the number of digits after the dot and before it?
Doron Sinai
  • 1,166
  • 3
  • 12
  • 28