Ada Programming/Ada 2005

This is an overview of the major features that are available in Ada 2005, the version of the Ada standard that was accepted by ISO in January 2007 (to differentiate it from its predecessors Ada 83 and Ada 95, the informal name Ada 2005 is generally agreed on). For the rationale and a more detailed (and very technical) description, see the Amendment to the Ada Reference Manual following the links to the last version of every Ada Issue document (AI).

Although the standard is now published, not all compilers will be able to handle it. Many of these additions are already implemented by the following Free Software compilers: After downloading and installing any of them, remember to use the  switch when compiling Ada 2005 code. Note that Ada 2005 is the default mode in GNAT GPL 2007 Edition.
 * GNAT GPL Edition
 * GCC 4.1
 * GNAT Pro 6.0.2 (the AdaCore supported version) is a complete implementation.

Character set
Not only does Ada 2005 now support a new 32-bit character type &mdash; called Wide_Wide_Character &mdash; but the source code itself may be of this extended character set as well. Thus Russians and Indians, for example, will be able to use their native language in identifiers and comments. And mathematicians will rejoice: The whole Greek and fractur character sets are available for identifiers. For example, Ada.Numerics will be extended with a new constant:

π : := Pi;

This is not a new idea &mdash; GNAT always had the -gnatic compiler option to specify the character set. But now this idea has become standard, so all Ada compilers will need to support Unicode 4.0 for identifiers &mdash; as the new standard requires.

See also:



Interfaces
Interfaces allow for a limited form of multiple inheritance similar to Java and C#.

You find a full description here: Ada Programming/OO.

See also:

Union
In addition to Ada's safe variant record an unchecked C style union is now available.

You can find a full description here: Ada Programming/Types/record.

See also:



With
The with statement got a massive upgrade. First there is the new limited with which allows two packages to with each other. Then there is private with to make a package only visible inside the private part of the specification.

See also:

Not null access
An access type definition can specify that the access type can never be null.

See Ada Programming/Types/access.

See also:

Anonymous access
The possible uses of anonymous access types are extended. They are allowed virtually in every type or object definition, including access to subprogram parameters. Anonymous access types may point to constant objects as well. Also, they could be declared to be not null.

With the addition of the following operations in package, it is possible to test the equality of anonymous access types.

"=" (Left, Right : universal_access) Boolean; "/="(Left, Right : universal_access) Boolean;

See Ada Programming/Types/access.

See also:

Containers
A major addition to the language library is the generic packages for containers. If you are familiar with the C++ STL, you will likely feel very much at home using. One thing, though: Ada is a block structured language. Many ideas of how to use the STL employ this feature of the language. For example, local subprograms can be supplied to iteration schemes.

The original Ada Issue text has now been transformed into .

If you know how to write Ada programs, and have a need for vectors, lists, sets, or maps (tables), please have a look at the mentioned above. There is an !example section in the text explaining the use of the containers in some detail. Matthew Heaney provides a number of demonstration programs with his reference implementation of AI-302 which you can find at tigris.

In Ada Programming/Containers you will find a demo using containers.

Historical side note: The C++ STL draws upon the work of David R. Musser and Alexander A. Stepanov. For some of their studies of generic programming, they had been using Ada 83. The Stepanov Papers Collection has a few publications available.

Scan Filesystem Directories and Environment Variables
See also:

Numerics
Besides the new constant of package (see Character Set above), the most important addition are the packages to operate with vectors and matrices.

See also:

(Related note on Ada programming tools: AI-388 contains an interesting assessment of how compiler writers are bound to perpetuate the lack of handling of international characters in programming support tools for now. As an author of Ada programs, be aware that your tools provider or Ada consultant could recommend that the program text be 7bit ASCII only.)

Real-Time and High Integrity Systems
See also:

Ravenscar profile
See also:

New scheduling policies
See also:

Dynamic priorities for protected objects
See also:

New keywords
Added 3 keywords (72 total)

New pragmas
Added 11 pragmas:

New attributes
Added 7 attributes:

New packages

 * Assertions:


 * Container library:
 * (generic procedure)
 * (generic procedure)
 * (generic procedure)
 * (generic procedure)
 * (generic procedure)


 * Vector and matrix manipulation:


 * General OS facilities:


 * String hashing:
 * (generic function)
 * (generic function)
 * (generic function)
 * (generic function)
 * (generic function)
 * (generic function)
 * (generic function)
 * (generic function)
 * (generic function)
 * (generic function)
 * (generic function)
 * (generic function)


 * Time operations:


 * Tagged types:
 * (generic function)


 * Text packages:


 * Wide_Wide_Character packages:


 * Execution-time clocks:


 * Dispatching:


 * Timing events:


 * Task termination procedures:

Wikibook

 * Ada Programming/Ada 83
 * Ada Programming/Ada 95
 * Ada Programming/Ada 2012
 * Ada Programming/Object Orientation
 * Ada Programming/Types/access
 * Ada Programming/Keywords
 * Ada Programming/Keywords/and
 * Ada Programming/Keywords/interface
 * Ada Programming/Attributes
 * Ada Programming/Pragmas
 * Ada Programming/Pragmas/Restrictions
 * Ada Programming/Libraries/Ada.Containers
 * Ada Programming/Libraries/Ada.Directories

Pages in the category Ada 2005

 * /Ada 2005 feature

Papers and presentations

 * Ada 2005: Putting it all together (SIGAda 2004 presentation)
 * GNAT and Ada 2005 (SIGAda 2004 paper)
 * An invitation to Ada 2005, and the presentation of this paper at Ada-Europe 2004

Rationale

 * Rationale for Ada 2005 by John Barnes:
 * Introduction
 * Object Oriented Model
 * Access Types
 * Structure and Visibility
 * Tasking and Real-Time
 * Exceptions, Generics, Etc.
 * Predefined Library
 * Containers
 * Epilogue
 * References
 * Index

Available as a single document for printing.

Language Requirements

 * Instructions to the Ada Rapporteur Group from SC22/WG9 for Preparation of the Amendment to ISO/IEC 8652 (10 October 2002), and a presentation of this document at SIGAda 2002

Ada Reference Manual

 * Ada Reference Manual, ISO/IEC 8652:1995(E) with COR.1:2001 and AMD.1:2007
 * Annotated Ada Reference Manual, ISO/IEC 8652:1995(E) with COR.1:2001 and AMD.1:2007 (colored diffs)
 * List of Ada Amendment drafts

Ada Issues

 * Amendment 200Y

|Ada 2005 *Ada 2005 *Ada 2005