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
30
votes
9 answers

Where is Ada used (apart from safety-critical software)?

When one thinks of Ada, one usually thinks of avionics. What I'm interested in are some other applications of Ada? Where is it used? Are there any shipped applications written in Ada? For example, are there CRUD apps written in it? Or games? Etc.
TraumaPony
  • 10,742
  • 12
  • 54
  • 74
29
votes
5 answers

How is Ada a 'safety critical' language?

I tried googling and read some snippets online. Why is Ada a "safety critical" language? Some things I notice are No pointers Specify a range (this type is an integer but can only be 1-12) Explicitly state if a function parameter is out or…
user34537
27
votes
6 answers

C++ vs. D , Ada and Eiffel (horrible error messages with templates)

One of the problems of C++ are horrible error messages that we are getting from code which intensively uses templates and template metaprogramming. The concepts are designed to solve this problem, but unfortunately they will not be in the next…
UmmaGumma
  • 5,633
  • 1
  • 31
  • 45
25
votes
8 answers

Web programming in Ada?

Does anyone do serious web development in Ada? Are there libraries or frameworks available for such tasks? I'm particularly interested in those that are free and open source. Any relevant pointers are appreciated.
mac
  • 253
  • 3
  • 4
25
votes
4 answers

Is there a difference between "and" vs "and then" in an IF statement

I'm learning Ada by fixing bugs and reading code. I've noticed some if statements that are ganged with "and" and others with "and then". similarly, there is "or" and other places there is "or else". A co-worker says it's just syntactic sugar and…
erict
  • 1,394
  • 2
  • 14
  • 28
24
votes
2 answers

When to use Pragma Pure/Preelaborate

Is there a set of general rules/guidelines that can help to understand when to prefer pragma Pure, pragma Preelaborate, or something else entirely? The rules and definitions presented in the standard (Ada 2012), are a little heavy-going and I'd be…
Anthony
  • 12,177
  • 9
  • 69
  • 105
22
votes
8 answers

Is it worth to learn Ada instead of another languages [c++, c#]?

If Im going to make robots, which language do you recommend me? In our university we can choose between several languages. Most of the students are choosing Ada just because our teacher uses it. After some research I found out that ada is old.…
user1012032
21
votes
7 answers

Ada for new project?

We are currently developing a noncritical moving map type navcomm solution for our Atom based avionics device. The prototype has been done in Python/Qt, now I need to decide on a language to use for the "real" app. Ada or C/C++. I've been a C++…
user478389
  • 219
  • 2
  • 4
20
votes
2 answers

The use of IN OUT in Ada

Given below is some code in ada with TYPE_VECT_B; use TYPE_VECT_B; Package TEST01 is procedure TEST01 ( In_State : IN VECT_B ; Out_State : IN OUT VECT_B ); function TEST02 ( In_State : IN …
maddy
  • 827
  • 2
  • 11
  • 19
19
votes
5 answers

Ada subtype equivalent in C++

Does C++ offer something similar to Ada's subtype to narrow a type? E.g.: type Weekday is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday); subtype Working_Day is Weekday range Monday .. Friday;
sornbro
  • 243
  • 3
  • 12
17
votes
4 answers

How to output Integers using the Put_Line method?

I can't get this program to compile because it doesn't seem to print integer variables along with strings in the Put_Line method. I've looked at source code online and it works when they do it so where am I going wrong. Thanks for your help. with…
W.K.S
  • 9,787
  • 15
  • 75
  • 122
17
votes
7 answers

How can I disable fail on warning when using GCC and Make?

I'm trying to build GCC for use with an AVR microcontroller and avr-ada, and I've hit a roadblock caused by my regular compiler being too picky about the version I needed for the AVR. I get the following warning, which in turn causes GCC or Make to…
Dr. Watson
  • 3,752
  • 4
  • 32
  • 43
17
votes
5 answers

Is there a free implementation of Ada?

I looked at the AdaCore site, as well as for A# (which now appears to be owned by AdaCore) and neither appear to be free (although I could have misread something). Any recommendations?
Thomas Owens
  • 114,398
  • 98
  • 311
  • 431
16
votes
4 answers

Ada compilers for Linux

I'm doing a trade study for Ada development on Linux. Do you have any good compiler/OS recommendations? So far, I've got GNAT from AdaCore running on CentOS 5.4, and I have license requests in for Rational Apex and Aonix ObjectAda. This is a porting…
Dave
  • 4,546
  • 2
  • 38
  • 59
16
votes
1 answer

Ada Function vs Procedure

Can anyone explain me the difference between the Ada "procedure" and "function"?
PeakGen
  • 21,894
  • 86
  • 261
  • 463
1
2 3
99 100