Ada is a programming language designed for large, long-lived applications where reliability and efficiency are essential.
Humans make mistakes.
Ada was designed to help us find mistakes.
We read programs more times than we write:
Ada was designed for ease of reading
An Ada program typically requires more typing than curly brace languages.
Ada Versions:
Ada 83 (1983)
Ada 95 (1995)
Ada 2005 (2005)
Ada 2012 (2012)
http://www.adacore.com/adaanswers/about/ada-comparison-chart
Why ‘Ada’ succeed where C fails?
No. #1 Reason: Modelling of scalar quantities
Strong typing
Run-time range checking
The adherence to strong typing allows detection of many common software errors (wrong parameters, range violations, invalid references, mismatched types, etc.) either during compile-time, or otherwise during run-time.
Other Reasons:
Named parameter association.
Arrays whose indices do not start at zero.
High level abstractions for modelling device registers
Record types
Enumeration types
High level of abstraction for tasking
Interfaces to other programming languages like C, COBAL, etc.
Compilation model
Obsolete units are detected.
few Ada Compilers:
GNAT (GNO Ada Translator)
GPS (GNAT Processing Studio) (V6.0.1)
Irvine Cross Compiler (ICC) Ada
Ada Keywords:
There are 73 reserved keywords in Ada that may not be used as identifiers, and these are:
Ada Data Types:
C laguage basic data types: int, char, float, double
Ada language basic data types: integer, character, float, boolean
Ada Operators:
//constant
#include<stdio.h>
int main(void)
{
const int n = 10;
n = 20; //error
printf("n=%d\n", n);
return 0;
}
with Ada.Text_IO;
with Ada.Integer_Text_IO;
use Ada.Text_IO;
use Ada.Integer_Text_IO;
procedure Hello is
n : constant integer := 10;
begin
n := 20; -- error
put(n);
end Hello;