Docsity

ADA History and Features - Programming Languages - Lecture Slides, Slides of Programming Languages

Partial preview of the text

Download ADA History and Features - Programming Languages - Lecture Slides and more Slides Programming Languages in PDF only on Docsity!

Design Goals

• Programs reliability and maintenance is

important

  • Military software systems are expected to have a minimum lifetime of 30 years

• Programming is a human activity

• Efficiency

"Hence emphasis was placed on program

readability over ease of writing"

Ada History

  • The need for a single standard language – 1975
  • Requirements document developed; strawman
  • Refined to Woodman and then Tinman – 1976
  • Further refined to ironman
  • Proposals were invited for the design of a new language
  • Four selected (green, red, blue, and yellow)
  • Initial designs were submitted in 1978
    • red and green proposals were short listed
  • Standard refined to steelman
  • The designs were refined further and finally ‘green’ was selected in 1979

Ada Features

  • Packages (modules) of related types, objects, and operations can be defined
  • Packages and types can be made generic (parameterized templates) to help create reusable components
  • It is strongly typed
  • Errors can be signaled as exceptions and handled explicitly. Many serious errors (such as computational overflow and invalid array indexes) are automatically caught and handled through this exception handling mechanism, thus improving program reliability

Ada Features

  • Tasks
    • Multiple parallel threads of control that can be used to create and communicate different threads of control. This is a major capability not supported in a standard way by many other languages

Ada “Hello World”

with Ada.Text_Io; -- intent to use

-- kind of include

use Ada.Text_Io; -- direct visibility

procedure Hello is -- procedure without

-- parameters is the -- starting point

begin

Put_Line("Hello World!");

end Hello;

not case sensitive

Ada Operators

Operator C/C++ Ada

Assignment = :=

Equality == =

Non Equality !=^ /=

Greater Than >^ >

Less Than < <

Greater Than Or Equal >= >=

Less Than Or Equal <= <=

Ada Operators

Operator C/C++ Ada

Modulus % mod

Remainder rem

AbsoluteValue abs

Exponentiation **

Range ..

Ada Operators

Operator C/C++ Ada

Membership in

Logical And && and

Logical Or ||^ or

Logical Not!^ not

Bitwise And & and

Bitwise Or | or

Bitwise Exclusive Or ^ xor

Bitwise Not ~^ not

String Concatenation &

Ada Types

  • Ada provides a large number of kinds of data

types

  • Ada does not have a predefined inheritance

hierarchy like many object oriented programming languages

  • Ada allows you to define your own data types,

including numeric data types

  • Defining your own type in Ada creates a new

type