Ada Language

Recently Updated:

The current standard is Ada 2012, the latest revision adds pre-conditions, post-conditions, type-invariants, expression functions, and qualitative expressions. This results in the ability to specify in active-code things that would generally require external tools to achieve (e.g. correctness-provers & documentation-generators) and allows the compiler/runtime to ensure reliability (as opposed to misleading or outdated comments). The Language Reference Manual is here: http://www.ada-auth.org/standards/ada12.html


From the JargonFile:

A Pascal-descended language that was at one time made mandatory for Department of Defense software projects by the Pentagon. Hackers are nearly unanimous in observing that, technically, it is precisely what one might expect given that kind of endorsement by fiat; bloated, crockish, difficult to use, and overall a disastrous, multi-billion-dollar boondoggle (one common description was "The PL/I of the 1980s"). The kindest thing that has been said about it is that there is probably a good small language screaming to get out from inside its vast, elephantine bulk.

Opposite stance, from Slashdot:

It's quite apparent that the evolution of the C family of languages (C, C++, Java, C#) is converging on a language very like Ada, except unfortunately as a kludgepile rather than a clean design.

The Ada FAQ list tries to clarify some of the more common misconceptions about Ada (http://www.adahome.com/FAQ/):

Ada is an advanced, modern programming language, designed and standardized to support widely recognized software engineering principles: reliability, portability, modularity, reusability, ProgrammingAsaHumanActivity, efficiency, maintainability, information hiding, abstract data types, concurrent programming, object-oriented programming, et cetera. All Ada compilers must pass a validation test.

Ada is a programming language designed to support the construction of long-lived, highly reliable software systems. The language includes facilities to define packages of related types, objects, and operations. The packages may be parameterized and the types may be extended to support the construction of libraries of reusable, adaptable software components. The operations may be implemented as subprograms using conventional sequential control structures, or as entries that include synchronization of concurrent threads of control as part of their invocation. The language treats modularity in the physical sense as well, with a facility to support separate compilation.

The language includes a complete facility for the support of real-time, concurrent programming. Errors can be signaled as exceptions and handled explicitly. The language also covers systems programming; this requires precise control over the representation of data and access to system-dependent properties. Finally, a predefined environment of standard packages is provided, including facilities for, among others, input-output, string manipulation, numeric elementary functions, and random number generation.

Also see http://www.adapower.com/, http://www.adaworld.com, http://www.adaic.org, http://www.ada-auth.org


Why was Ada developed? The truth can now be told ;->

Has anyone else here actually used Ada? I wrote in Ada for two years. My experience was that its extremely consistent data-typing rules and high readability gave me the highest productivity and lowest bug rate of any environment I've used before or since. Calling Ada "bloated, crockish, difficult to use" is ignorant; it has a very small number of keywords and constructs. Ada makes TASK a part of the language in contrast to Java exposing Threads through a library; big deal. Tasks, exceptions, and generics (a construct we only got in Java with J2SE 5) may look like language bloat to some; the interminable cavalcade of Java libraries looks a bit hefty to me. I hate worrying about counting parentheses, braces, and commas and in Ada I never had to. I would say that in Ada more than any language I've ever personally used (or seen) it is possible to truly express and recognize DESIGN.

According to the Shootout results, Ada (using GNAT) has very good speed/memory usage. I hear the idea of Ada being "sluggish" and "bloated" came from the crap compilers that first started to appear (after the language was already defined). Later, (someone said around 1989) much better compilers came out.


Ada was named for Ada Byron, Lady Lovelace (1815-1852), daugther of Lord Byron the poet, commonly regarded as the first computer programmer because she developed a form of code for Charles Babbage's Analytical Engine. It computed Bernoulli numbers, a passion among mathematicians of the time. The first Ada standard was Ada 83. The second, Ada 95, added mainly object orientation. Ada 2005 adds a C++-like dot notation for dispatching calls on objects, anonymous operations, improved generics, libraries including one for containers (vectors, sets, maps), and much more.


I personally don't use Ada as I mostly program in Java and C++, and Ruby at times. I've looked into Ada and although I currently don't have a use for it I found some features that are actually quite useful. I don't know of another language that has entry's for example such that you can have one Thread waiting for another Thread but only if it doesn't take too long or if another entry doesn't open. -- ChristophePoucet?
HenryBaker also wrote a bunch of Ada-related papers.


Is Ada overly verbose? This is HelloWorld in Ada:

 with Text_IO;

procedure HelloWorld is begin Text_IO.Put_Line("Hello world!"); end HelloWorld;

Compare with the other versions offered on HelloWorldInManyProgrammingLanguages.

HelloWorld is a terrible metric of verbosity. HelloWorld is not representative of any real-world program for any real-world problem domain.

Nonsense. It's a measure of how much arbitrary crap the language makes you put up with even when it has nothing whatsoever to do with solving the damn problem. A language where Hello World is a huge program is a bondage freak's dream. I see Ada as a verbose language, however, unlike say JavaLanguage, the verbosity actually benefits readability.
Although closely related, too many people confuse verbosity with boilerplate. Ada may be verbose, but from what I can see above, it doesn't look like it requires much in the way of obligatory boilerplate. However, compare the above program with a CeeLanguage implementation of HelloWorld written for use in a ComponentObjectModel environment. C is hardly considered to be verbose, and yet, the boilerplate involved with such a program would make even CobolLanguage programmers chuckle.

Moreover, languages with large boilerplate requirements tend to have a shallower slope in its problem-complexity-vs-lines-of-code graph. [Is there a study I can peruse regarding this?] Hence, languages with large boilerplate requirements will obviously be ill-suited to simple tests as above, but might find niches in very tough problem domains, such as in mission-critical medical and aerospace applications (which, as it turns out, is precisely where Ada finds its niche).

Ada is arguably more successful in its domain not because of its ridiculous verbosity, but because it has higher level features, separation of concerns, safety checks, development teams focused on embedded programming, aircraft specialists and programmers working on the compilers, etc. One could still take all of these same Ada experts, brainwash them, and have them (or another team with more sense) implement a more reasonable syntax and notation while keeping the same range checks, contract checks, safety checks, stack abilities, separation of concerns (type declarations, arrays vs pointers to pointers, by reference vs by value or in/out params, modules, high level threading abilities, sub modules, packages). In fact it has been visually proven that a baroque hideous language can be trimmed down to an arguably just as readable or more readable notation already on this wiki on other pages. Ada, and even Oberon style syntax are borderline cases (or in some people's opinion, are cases) of disobeying Dijkstra's recommendations: Finally, DijkstraIsntGod. Stop pretending that he is the grand purveyor of all wisdom of computer-related knowledge. It gets old.
References

I strongly recommend Ada As A Second Language by Norman Cohen, (ISBN 0070116075 , ISBN 978-0070116078 ), it is 1133 pages, and easy to read, but not overly verbose.

For some downloadable books on Ada see: The GNAT compiler and other tool (Ada Web Server, PolyORB, GtkAda?, ...) can be found at https://libre.adacore.com/

There is a great Ada like scripting language, Business shell, BUSH: http://www.pegasoft.ca/docs/bushintro.html

  BUSH vs. Ada 95
    Ada 95 (named after the world's first programmer) is a multithreaded,
    exception handling, object-oriented programming language used for large,
    high-integrity projects. It is known for abundant features, high performance,
    strong checking and readability.

The BUSH shell is not an Ada interpreter. BUSH uses AdaScript?, a subset of the Ada 95 language with additional features specifically for interactive shell sessions. Because of its Ada 95 background, BUSH scripts are easy to create, maintain, debug and can be compiled into fast, executable programs using an Ada 95 compiler.


I thought this was an interesting quote:

   Ada didn't have type extension and dynamic binding, and so missed the
   boat on the object technology revolution....

You have to understand the climate of the times. Ada was largely a reaction to languages like Fortran. They [the commissioners -- the Dod] wanted once and for all to determine everything at compile time, so you could eliminate errors like the parameters of an invocation of a subprogram not agreeing with the parameters of the declaration. Certainly not an unreasonable desire!

http://www.adapower.com/index.php?Command=Class&ClassID=Advocacy&CID=39

It seems like a reasonable design goal to me for the intended niche, even now.
Also see ExtremeAdaExperiment AdaUnit CeeVsAdaStudy
MayZeroEight

CategoryProgrammingLanguage

EditText of this page (last edited February 10, 2013) or FindPage with title or text search