Ada (programming language): Difference between revisions

Content deleted Content added
m Standardization: fix common MOS:REFSPACE spacing errors, replaced: {{Efn → {{Efn, /ref>( → /ref> ( (2)
 
(36 intermediate revisions by 26 users not shown)
Line 3:
| name = Ada
| logo = Ada horizon green logo with slogan.svg
| logo_size = 200px
| logo alt = Green logo on horizon with Ada letters and slogan
| paradigm = [[Multi-paradigm programming language|Multi-paradigm]]: [[Structured programming|structured]], [[Imperative programming|imperative]], [[Object-oriented programming|object-oriented]], [[Aspect-oriented programming|aspect-oriented]],<ref>{{cite web|url=http://www.adacore.com/uploads/technical-papers/Ada2012_Rational_Introducion.pdf|title=Ada2012 Rationale|website=adacore.com|access-date=5 May 2018|url-status=live|archive-url=https://web.archive.org/web/20160418132340/http://www.adacore.com/uploads/technical-papers/Ada2012_Rational_Introducion.pdf|archive-date=18 April 2016}}</ref> [[Concurrent programming|concurrent]], [[Array programming|array]], [[Distributed computing|distributed]], [[Generic programming|generic]], [[Procedural programming|procedural]], [[Metaprogramming|meta]]
Line 12 ⟶ 13:
| developer =
| typing = [[Static typing|static]], [[Strong and weak typing|strong]], [[Type safety|safe]], [[Nominal type system|nominal]]
| implementations = AdaCore [[GNAT]],<ref>{{Cite web|url=https://www.adacore.com/download|title=Commercial software solutions for Ada, C and C++|website=AdaCore|accessdateaccess-date=Apr 4, 2023}}</ref><br/>[[Green Hills Software]] Optimising Ada 95 compiler,<br/>[[PTC (software company)|PTC]] ApexAda and ObjectAda,<ref>{{cite webnews|url=http://www.ptc.com/developer-tools/objectada |title=PTC ObjectAda |publisher=PTC.com |access-date=2014-01-27}}</ref><br/>MapuSoft Ada-C/C++ changer,<ref>{{cite web|url=https://www.mapusoft.com/ada-to-c-changer/|title=MapuSoft Ada-C/C++ changer|date=16 April 2019}}</ref> formerly known as "AdaMagic with C Intermediate",<ref>{{Cite web|url=http://ada-auth.org/cpl/details/151.html|title=Ada 95 Certified Processors List – Details|website=ada-auth.org|accessdateaccess-date=Apr 4, 2023}}</ref><br/>[[DDC-I]] Score
| dialects = [[SPARK (programming language)|SPARK]], [[Ravenscar profile]]
| influenced = [[C++]], [[Chapel (programming language)|Chapel]],<ref>{{cite web|title=Chapel spec (Acknowledgements)|url=http://chapel.cray.com/spec/spec-0.98.pdf |archive-url=https://ghostarchive.org/archive/20221009/http://chapel.cray.com/spec/spec-0.98.pdf |archive-date=2022-10-09 |url-status=live|date=2015-10-01|access-date=2016-01-14|publisher=Cray Inc}}</ref> [[Drago (programming language)|Drago]],<ref>{{cite web|url=http://www.iuma.ulpgc.es/users/gsd/Drago/|title=Drago|access-date=2018-08-06|archive-date=2020-09-14|archive-url=https://web.archive.org/web/20200914212150/http://www.iuma.ulpgc.es/users/gsd/Drago/|url-status=dead}}</ref> [[D (programming language)|D]], [[Eiffel (programming language)|Eiffel]], Griffin,<ref>{{Cite web|url=https://cs.nyu.edu/~goldberg/griffin.html|title=The Griffin Project|website=cs.nyu.edu|accessdateaccess-date=Apr 4, 2023}}</ref> [[Java (programming language)|Java]], [[Nim (programming language)|Nim]], [[ParaSail (programming language)|ParaSail]], [[PL/SQL]], [[PL/pgSQL]], [[Python (programming language)|Python]], [[Ruby (programming language)|Ruby]], [[Seed7]], SPARforte,<ref>{{Cite web|url=https://www.sparforte.com/|title=SparForte Programming Language|website=www.sparforte.com|accessdateaccess-date=Apr 4, 2023}}</ref> [[ParaSail (programming language)#Description|Sparkel]], [[SQL/PSM]], [[VHDL]]
| license =
| released = {{Start date and age|1980|02}}
Line 21 ⟶ 22:
| latest preview version =
| latest preview date =
| influenced by = [[ALGOL 68]], [[Pascal (programming language)|Pascal]], [[Simula 67]] 67,<ref>Ada Rationale, 1986, pp. 23, 70, 110–114, 137, 165, 236</ref> [[C++]] (Ada 95), [[Smalltalk]] (Ada 95), [[Modula-2]] (Ada 95) [[Java (programming language)|Java]] (Ada 2005), [[Eiffel (programming language)|Eiffel]] (Ada 2012)
| operating system = Multi- or [[cross-platform]]
| file ext = .adb, .ads
| website = {{URL|https://www.adaic.org/|adaic.org}}
| wikibooks = Ada Programming
}}
 
[[File:Ada Mascot with slogan.svg|thumb|Ada mascot with slogan]]
'''Ada''' is a [[structured programming|structured]], [[statically typed]], [[Imperative programming|imperative]], and [[Object-oriented programming|object-oriented]] [[high-level programming language]], inspired by [[Pascal (programming language)|Pascal]] and other languages. It has built-in language support for ''[[design by contract]]'' (DbC), extremely [[Strong and weak typing|strong typing]], explicit concurrency, tasks, synchronous message passing, protected objects, and [[nondeterministic programming|non-determinism]]. Ada improves code safety and maintainability by using the [[compiler]] to find errors in favor of [[Runtime (program lifecycle phase)|runtime]] errors. Ada is an [[International standard|international]] [[technical standard]], jointly defined by the [[International Organization for Standardization]] (ISO), and the [[International Electrotechnical Commission]] (IEC). {{As of|May 2023}}, the standard, called Ada 2022 informally, is ISO/IEC 8652:2023.<ref name="ada-letters-june2023">{{cite journal | first=Luis Miguel | last=Pinho | title=From the Editor's Desk | journal=Ada Letters | volume=XLIII | number=1 | publisher=Association for Computing Machinery | date=June 2023 | page=3 | doi=10.1145/3631483 | doi-broken-date=2024-09-11 | url=https://dl.acm.org/action/showFmPdf?doi=10.1145%2F3631483}}</ref>
 
'''Ada''' is a [[structured programming|structured]], [[statically typed]], [[Imperative programming|imperative]], and [[Object-oriented programming|object-oriented]] [[high-level programming language]], inspired by [[Pascal (programming language)|Pascal]] and other languages. It has built-in language support for ''[[design by contract]]'' (DbC), extremely [[Strong and weak typing|strong typing]], explicit concurrency, tasks, synchronous [[message passing]], protected [[Object (computer science)|objects]], and [[nondeterministic programming|non-determinism]]. Ada improves code safety and maintainability by using the [[compiler]] to find errors in favor of [[Runtime (program lifecycle phase)|runtime]] errors. Ada is an [[International standard|international]] [[technical standard]], jointly defined by the [[International Organization for Standardization]] (ISO), and the [[International Electrotechnical Commission]] (IEC). {{As of|May 2023}}, the standard, called Ada 2022 informally, is ISO/IEC 8652:2023, is called Ada 2022 informally.<ref name="ada-letters-june2023">{{cite journal |last1=Pinho first|first1=Luis Miguel | last=Pinho | title=From the Editor's Desk | journal=Ada Letters | volume=XLIII | number=1 | publisher=Association for Computing Machinery | date=June 2023 | page=3 | doi=10.1145/3631483 | doi-broken-date=2024-09-111 July 2025 | url=https://dl.acm.org/action/showFmPdf?doi=10.1145%2F3631483}}</ref>
Ada was originally designed by a team led by French [[computer scientist]] [[Jean Ichbiah]] of [[Groupe Bull|Honeywell]] under contract to the [[United States Department of Defense]] (DoD) from 1977 to 1983 to supersede over 450 programming languages used by the DoD at that time.<ref>{{cite web|title=The Ada Programming Language|url=http://groups.engin.umd.umich.edu/CIS/course.des/cis400/ada/ada.html|website=University of Mich|access-date=27 May 2016|url-status=dead|archive-url=https://web.archive.org/web/20160522063844/http://groups.engin.umd.umich.edu/CIS/course.des/cis400/ada/ada.html|archive-date=2016-05-22}}</ref> Ada was named after [[Ada Lovelace]] (1815–1852), who has been credited as the first computer programmer.<ref>{{cite journal|doi=10.1109/MAHC.2003.1253887|title=Lovelace & Babbage and the creation of the 1843 'notes'|journal=IEEE Annals of the History of Computing|volume=25|issue=4|pages=16–26|year=2003|last1=Fuegi|first1=J|last2=Francis|first2=J|s2cid=40077111}}</ref>
 
Ada was originally designed by a team led by French [[computer scientist]] [[Jean Ichbiah]] of [[Groupe Bull|Honeywell]] under contract to the [[United States Department of Defense]] (DoD) from 1977 to 1983 to supersede over 450 programming languages then used by the DoD at that time.<ref>{{cite web|title=The Ada Programming Language|url=http://groups.engin.umd.umich.edu/CIS/course.des/cis400/ada/ada.html|website=University of Mich|access-date=27 May 2016|url-status=dead|archive-url=https://web.archive.org/web/20160522063844/http://groups.engin.umd.umich.edu/CIS/course.des/cis400/ada/ada.html|archive-date=2016-05-22}}</ref> Ada was named after [[Ada Lovelace]] (1815–1852), who has been credited as the first computer programmer.<ref>{{cite journal|doi=10.1109/MAHC.2003.1253887|title=Lovelace & Babbage and the creation of the 1843 'notes'|journal=IEEE Annals of the History of Computing|volume=25|issue=4|pages=16–26|year=2003|last1=Fuegi|first1=J|last2=Francis|first2=J|s2cid=40077111}}</ref>
 
== Features ==
Ada was originally designed for [[embedded system|embedded]] and [[real-time computing|real-time]] systems. The Ada&nbsp;95 revision, designed by S. Tucker Taft of [[Intermetrics]] between 1992 and 1995, improved support for systems, numerical, financial, and [[object-oriented programming]] (OOP).
 
Features of Ada include: [[Strong and weak typing|strong typing]], [[modular programming]] mechanisms ([[Modular programming|packages]]), [[run-time checking]], [[Parallel computing|parallel processing]] ([[Task (computing)|tasks]], synchronous [[message passing]], protected objects, and nondeterministic [[Switch statement|select statements]]), [[exception handling]], and [[generic programming|generics]]. Ada&nbsp;95 added support for [[object-oriented programming]], including [[dynamic dispatch]].
 
The [[Syntax (programming languages)|syntax]] of Ada minimizes choices of ways to perform basic operations, and prefers English keywords (such as "{{code|or else"}} and "{{code|and then"}}) to symbols (such as "{{code||"{{!}}{{!}}}} and "{{code|&&"}}). Ada uses the basic arithmetical operators "{{code|+"}}, "{{code|-"}}, "{{code|*"}}, and "{{code|/"}}, but avoids using other symbols. Code blocks are delimited by words such as "'declare"', "'begin"', and "'end"', where the "'end"' (in most cases) is followed by the identifierkeyword of the block that it closes (e.g., ''{{code|if}} ... {{code|end if''}}, ''{{code|loop}} ... {{code|end loop''}}). In the case of conditional blocks this avoids a ''[[dangling else]]'' that could pair with the wrong nested 'if'-expression in other languages likesuch as C or Java.
 
Ada is designed for developing very large software systems. Ada packages can be compiled separately. Ada package specifications (the package interface) can also be compiled separately without the implementation to check for consistency. This makes it possible to detect problems early during the design phase, before implementation starts.
 
A large number of [[Compile time|compile-time]] checks are supported to help avoid bugs that would not be detectable until run-time in some other languages or would require explicit checks to be added to the source code. For example, the syntax requires explicitly named closing of blocks to prevent errors due to mismatched end tokens. The adherence to strong typing allows detecting many common software errors (wrong parameters, range violations, invalid references, mismatched types, etc.) either during compile-time, or otherwise during run-time. As concurrency is part of the language specification, the [[compiler]] can in some cases detect potential [[Deadlock (computer science)|deadlocks.]]<ref>{{cite webbook |url=https://www.adaic.org/resources/add_content/docs/95style/html/sec_6/|titlechapter=Concurrency – Chapter 6 – |title=Ada 95 QUALITYQuality ANDand STYLEStyle Guide|websitepublisher=adaic.orgAda Information Clearinghouse |access-date=November 5, 2021}}</ref> Compilers also commonly check for misspelled [[Identifier|identifiersidentifier]]s, visibility of packages, redundant declarations, etc. and can provide warnings and useful suggestions on how to fix the error.
 
Ada also supports [[Runtime system|run-time]] checks to protect against access to unallocated memory, [[buffer overflow]] errors, range violations, [[off-by-one error]]s, array access errors, and other detectable bugs. These checks can be disabled in the interest of runtime efficiency, but can often be compiled efficiently. It also includes facilities to help [[software verification|program verification]]. For these reasons, Ada is sometimes used in critical systems, where any [[anomaly in software|anomaly]] might lead to very serious consequences, e.g., accidental death, injury or severe financial loss. Examples of systems where Ada is used include [[avionics]], [[air traffic control]], [[Rail transport|railways]], banking, military and [[space technology]].<ref>{{cite web|title=Ada helps churn out less-buggy code|url=http://gcn.com/Articles/1999/06/30/Ada-helps-churn-out-lessbuggy-code.aspx|publisher=Government Computer News|access-date=2010-09-14|last1=Taft|first1=S. Tucker|last2=Olsen|first2=Florence|pages=2–3|date=1999-06-30|archive-date=2015-08-31|archive-url=https://web.archive.org/web/20150831211902/http://gcn.com/Articles/1999/06/30/Ada-helps-churn-out-lessbuggy-code.aspx|url-status=dead}}</ref><ref name="Ada_usage">{{cite web |last=Feldman |first=Michael |title=Who's Using Ada? Real-World Projects Powered by the Ada Programming Language November 2014 |url=https://www2.seas.gwu.edu/~mfeldman/ada-project-summary.html#Banking_and_Financial_Systems |publisher=SIGAda Education Working Group}}</ref>
 
{{anchor|Access type}}Ada's dynamic [[memory management]] is high-level and type-safe. Ada has no generic or untyped [[Pointer (computer programming)|pointers]]; nor does it implicitly declare any pointer type. Instead, all dynamic memory allocation and deallocation must occur via explicitly declared ''access types''. Each access type has an associated ''storage pool'' that handles the low-level details of memory management; the programmer can either use the default storage pool or define new ones (this is particularly relevant for [[Non-Uniform Memory Access]]). It is even possible to declare several different access types that all designate the same type but use different storage pools. Also, the language provides for ''accessibility checks'', both at compile time and at run time, that ensures that an ''access value'' cannot outlive the type of the object it points to.<ref>[https://youtube.com/watch?v=RyY01fRyGhM&t=419 no safe dynamic memory management in ADA], in: Writing Linux Kernel Modules in Safe Rust – Geoffrey Thomas & Alex Gaynor , The Linux Foundation, 2019-10-02</ref>
 
Though the semantics of the language allow automatic [[garbage collection (computer science)|garbage collection]] of inaccessible objects, most implementations do not support it by default, as it would cause unpredictable behaviour in real-time systems. Ada does supportsupports a limited form of [[region-based memory management]]; also, creativeand usein of storage pools can provide for a limited form of automatic garbage collectionAda, since destroying a storage pool also destroys all the objects in the pool.
 
A double-[[dash]] ("{{code|--"}}), resembling an [[em dash]], denotes comment text. Comments stop at end of line; there is intentionally no way to make a comment span multiple lines, to prevent unclosed comments from accidentally voiding whole sections of source code. Disabling a whole block of code therefore requires the prefixing of each line (or column) individually with "{{code|--"}}. While this clearly denotes disabled code by creating a column of repeated "'--"' down the page, it also renders the experimental dis/re-enablement of large blocks a more drawn-out process in editors without block commenting support.
 
The semicolon ("{{code|;"}}) is a [[statement terminator]], and the null or no-operation statement is <{{code>|null;</code>}}. A single <{{code>|;</code>}} without a statement to terminate is not allowed.
 
Unlike most [[International Organization for Standardization|ISO]] standards, the Ada language definition (known as the ''Ada Reference Manual'' or ''ARM'', or sometimes the ''Language Reference Manual'' or ''LRM'') is [[free content]]. Thus, it is a common reference for Ada programmers, not only programmers implementing Ada compilers. Apart from the reference manual, there is also an extensive rationale document which explains the language design and the use of various language constructs. This document is also widely used by programmers. When the language was revised, a new rationale document was written.
 
One notable [[free software]] tool that is used by many Ada programmers to aid them in writing Ada source code is the GNAT Programming Studio, and [[GNAT]] which is part of the [[GNU Compiler Collection]].
 
''Alire'' is a package and toolchain management tool for Ada.<ref>{{Cite web | url = https://alire.ada.dev | title= Alire - Homepage | publisher = Adacore | access-date = 2024-12-09}}</ref>
 
== History ==
In the 1970s the [[United States Department of Defense|US Department of Defense]] (DoD) became concerned by the number of different programming languages being used for its embedded computer system projects, many of which were obsolete or hardware-dependent, and none of which supported safe modular programming. In 1975, a [[working group]], the [[High Order Language Working Group]] (HOLWG), was formed with the intent to reduce this number by finding or creating a programming language generally suitable for the department's and the [[Ministry of Defence (United Kingdom)|UK Ministry of Defence]]'s requirements. After many iterations beginning with an original [[Straw man proposal|straw-man proposal]]<ref>{{Cite web|url=http://iment.com/maida/computer/requirements/strawman.htm|title=DoD – Strawman Requirements – April 1975|website=iment.com|accessdateaccess-date=Apr 4, 2023}}</ref> the eventual programming language was named Ada. The total number of high-level programming languages in use for such projects fell from over 450 in 1983 to 37 by 1996.
 
HOLWG crafted the '''<span class="anchor" id="Steelman language requirements">Steelman language requirements</span>''' , a series of documents stating the requirements they felt a programming language should satisfy. Many existing languages were formally reviewed, but the team concluded in 1977 that no existing language met the specifications. The requirements were created by the [[United States Department of Defense]] in ''The Department of Defense Common High Order Language program'' in 1978. The predecessors of this document were called, in order, "Strawman", "Woodenman", "Tinman" and "Ironman".<ref>Department of Defense (June 1978), [https://web.archive.org/web/20200914235620/https://dwheeler.com/steelman/steelman.htm Requirements for High Order Computer Programming Languages: "Steelman"]</ref> The requirements focused on the needs of [[embedded systems|embedded]] computer applications, and emphasised reliability, maintainability, and efficiency. Notably, they included [[exception handling]] facilities, [[run-time checking]], and [[parallel computing]].
 
It was concluded that no existing language met these criteria to a sufficient extent,<ref>SoftTech Inc. (1976), [[iarchive:DTIC ADA037637/mode/2up|"Evaluation of ALGOL 68, Jovial J3B, Pascal, Simula 67, and TACPOL Versus TINMAN - Requirements for a Common High Order Programming Language."]] - See also: [[ALGOL 68]], [[JOVIAL]] J3B, [[Pascal (programming language)|Pascal]], [[Simula]] 67, and TACPOL (Defense Technical Information Center - DTIC ADA037637, Report Number 1021-14)</ref> so a contest was called to create a language that would be closer to fulfilling them. The design that won this contest became the Ada programming language. The resulting language followed the Steelman requirements closely, though not exactly.
 
HOLWG crafted the [[Steelman language requirements]], a series of documents stating the requirements they felt a programming language should satisfy. Many existing languages were formally reviewed, but the team concluded in 1977 that no existing language met the specifications.
[[File:Ada Lovelace portrait.jpg|thumb|225x225px|Watercolour painting of Ada Lovelace]]
Requests for proposals for a new programming language were issued and four contractors were hired to develop their proposals under the names of Red ([[Intermetrics]] led by Benjamin Brosgol), Green ([[Honeywell]], led by [[Jean Ichbiah]]), Blue ([[SofTech, Inc.|SofTech]], led by John Goodenough)<ref>{{cite web|url=http://www.sei.cmu.edu/about/people/jbg.cfm |title=John Goodenough &#124; SEI Staff Profile |publisher=Sei.cmu.edu |access-date=2014-01-27}}</ref> and Yellow ([[SRI International]], led by Jay Spitzen).<!-- Though Intermetrics and Bull have previous links, I am including them for parallelism. --> In April 1978, after public scrutiny, the Red and Green proposals passed to the next phase. In May 1979, the Green proposal, designed by Jean Ichbiah at Honeywell, was chosen and given the name Ada—after Augusta Ada King, Countess of Lovelace, usually known as [[Ada Lovelace]]. This proposal was influenced by the language [[LIS (programming language)|LIS]] that Ichbiah and his group had developed in the 1970s. The preliminary Ada reference manual was published in ACM SIGPLAN Notices in June 1979. The Military Standard reference manual was approved on December 10, 1980 (Ada Lovelace's birthday), and given the number MIL-STD-1815 in honor of Ada Lovelace's birth year. In 1981, [[Tony Hoare]] took advantage of his [[Turing Award]] speech to criticize Ada for being overly complex and hence unreliable,<ref>{{cite journal |last=C.A.R. |first=Hoare |author-link=Tony Hoare |date=1981 |title=The Emperor's Old Clothes |url=http://zoo.cs.yale.edu/classes/cs422/2011/bib/hoare81emperor.pdf |url-status=live |journal=Communications of the ACM |publisher=[[Association for Computing Machinery]] |volume=24 |issue=2 |pages=75–83 |doi=10.1145/358549.358561 |s2cid=97895 |archive-url=https://web.archive.org/web/20160304012013/http://zoo.cs.yale.edu/classes/cs422/2011/bib/hoare81emperor.pdf |archive-date=2016-03-04 |doi-access=free}}</ref> but subsequently seemed to recant in the foreword he wrote for an Ada textbook.<ref>{{cite book |last1=Watt |first1=D.A. |last2=Wichmann |first2=B.A. |last3=Findlay |first3=W. |title=Ada: Language and Methodology |publisher=Prentice-Hall |date=1987}}</ref>
 
Ada attracted much attention from the programming community as a whole during its early days. Its backers and others predicted that it might become a dominant language for general purpose programming and not only defense-related work.<ref name="sward" /> Ichbiah publicly stated that within ten years, only two programming languages would remain: Ada and [[Lisp (programming language)|Lisp]].<ref name="SIGAda-Rosen">{{cite journal |last=Rosen |first=J-P. |title=The Ada Paradox(es) |journal=Ada Letters |publisher=ACM SIGAda |volume=24 |issue=2 |date=August 2009 |pages=28–35|doi=10.1145/1620593.1620597 |s2cid=608405}}</ref> Early Ada compilers struggled to implement the large, complex language, and both compile-time and run-time performance tended to be slow and tools primitive.<ref name="sward" /> Compiler vendors expended most of their efforts in passing the massive, language-conformance-testing, government-required [[Ada Compiler Validation Capability]] (ACVC) validation suite that was required in another novel feature of the Ada language effort.<ref name="SIGAda-Rosen" /> [[The Jargon File]], a dictionary of computer hacker slang originating in 1975–1983, notes in an entry on Ada that "it is precisely what one might expect given that kind of endorsement by fiat; designed by committee...difficult to use, and overall a disastrous, multi-billion-dollar boondoggle...Ada Lovelace...would almost certainly blanch at the use her name has been latterly put to; 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."<ref>{{cite web |url=http://www.catb.org/jargon/oldversions/jarg262.txt |format=TXT |title=THIS IS THE JARGON FILE, VERSION 2.6.2 |date=1991-02-14 |accessdate=2023-01-31}}</ref>
 
The first validated Ada implementation was the NYU Ada/Ed translator,<ref>{{cite web |url=http://oai.dtic.mil/oai/oai?verb=getRecord&metadataPrefix=html&identifier=ADA136759 |title=Ada Compiler Validation Summary Report: NYU Ada/ED, Version 19.7 V-001 |author=SofTech Inc. |place=Waltham, MA |date=1983-04-11 |access-date=2010-12-16 |archive-url=https://web.archive.org/web/20120312080046/http://oai.dtic.mil/oai/oai?verb=getRecord&metadataPrefix=html&identifier=ADA136759 |archive-date=2012-03-12 |url-status=dead}}</ref> certified on April 11, 1983. NYU Ada/Ed is implemented in the high-level set language [[SETL]].<ref>{{cite book |last1=Dewar |first1=Robert B. K. |last2=Fisher |first2=Gerald A. Jr. |last3=Schonberg |first3=Edmond |last4=Froelich |first4=Robert |last5=Bryant |first5=Stephen |last6=Goss |first6=Clinton F. |last7=Burke |first7=Michael |title=Proceeding of the ACM-SIGPLAN symposium on Ada programming language – SIGPLAN '80 |chapter=The NYU Ada translator and interpreter |volume=15 |issue=11 |pages=194–201 |date=November 1980 |isbn=0-89791-030-3 |doi=10.1145/948632.948659|s2cid=10586359}}</ref> Several commercial companies began offering Ada compilers and associated development tools, including [[Alsys]], [[TeleSoft]], [[DDC-I]], [[Advanced Computer Techniques]], [[Tartan Laboratories]], [[Irvine Compiler]], [[TLD Systems]], and [[Verdix]].<ref name="adaic-1992">{{cite news |title=Ada Validated Compilers List |publisher=Ada Information Clearinghouse |date=July 1, 1992 |pages=1–36}}</ref> Computer manufacturers who had a significant business in the defense, aerospace, or related industries, also offered Ada compilers and tools on their platforms; these included [[Concurrent Computer Corporation]], [[Cray Research, Inc.]], [[Digital Equipment Corporation]], [[Harris Computer Systems]], and [[Siemens Nixdorf Informationssysteme AG]].<ref name="adaic-1992" />
 
In 1991, the US Department of Defense began to require the use of Ada (the ''Ada mandate'') for all software,<ref>{{cite web|url=http://archive.adaic.com/pol-hist/policy/mandate.txt |title=The Congressional Ada Mandate |author=Ada Information Clearinghouse |date=1983-04-111994 |access-date=2015-06-07 |url-status=dead |archive-url=https://web.archive.org/web/20160304073005/http://archive.adaic.com/pol-hist/policy/mandate.txt |archive-date=2016-03-04}}</ref> though exceptions to this rule were often granted.<ref name="sward" /> The Department of Defense Ada mandate was effectively removed in 1997, as the DoD began to embrace [[commercial off-the-shelf]] (COTS) technology.<ref name="sward">{{cite conference |contribution=The rise, fall and persistence of Ada |first=Ricky E. |last=Sward |date=November 2010 |title=SIGAda '10: Proceedings of the ACM SIGAda annual international conference on SIGAda |pages=71–74 |url=http://dl.acm.org/citation.cfm?id=1879063.1879081&coll=DL&dl=GUIDE&CFID=551420221&CFTOKEN=60383966 | doi=10.1145/1879063.1879081|isbn=978-1-4503-0027-8|url-access=subscription }}</ref> Similar requirements existed in other [[North Atlantic Treaty Organization|NATO]] countries: Ada was required for NATO systems involving [[command and control]] and other functions, and Ada was the mandated or preferred language for defense-related applications in countries such as Sweden, Germany, and Canada.<ref>{{cite book |url=http://apps.dtic.mil/dtic/tr/fulltext/u2/a217657.pdf |archive-url=https://web.archive.org/web/20191215065214/http://www.dtic.mil/dtic/tr/fulltext/u2/a217657.pdf |url-status=live |archive-date=December 15, 2019 |first=Nicholas J. |last=Babiak |title=Ada, the New DoD Weapon System Computer Language – Panacea or Calamity |publisher=[[Air University (United States Air Force)]] |date=1989 |pages=39–40}}</ref>
 
By the late 1980s and early 1990s, Ada compilers had improved in performance, but there were still barriers to fully exploiting Ada's abilities, including a tasking model that was different from what most real-time programmers were used to.<ref name="SIGAda-Rosen" />
 
Because of Ada's [[Safety-critical system|safety-critical]] support features, it is now used not only for military applications, but also in commercial projects where a software bug can have severe consequences, e.g., [[avionics]] and [[air traffic control]], commercial rockets such as the [[Ariane (rocket family)|Ariane 4 and 5]], [[satellite]]s and other space systems, railway transport and banking.<ref name="Ada_usage" />
For example, the [[Primary Flight Control System]], the [[Aircraft flight control systems|fly-by-wire]] system software in the [[Boeing 777]], was written in Ada, as were the fly-by-wire systems for the aerodynamically unstable [[Eurofighter Typhoon]],<ref>{{cite web |date=16 June 1999 |title=Agile thinking |url=https://www.flightglobal.com/agile-thinking/26933.article |url-status=live |archive-url=https://web.archive.org/web/20210415054346/https://www.flightglobal.com/agile-thinking/26933.article |archive-date=15 April 2021 |access-date=13 Feb 2024 |website=FlightGlobal}}</ref> [[Saab JAS 39 Gripen|Saab Gripen]],<ref>{{Cite web |last=Frisberg |first=Bo |title=Usage of Ada in the Gripen Flight Control System |url=https://www.sigada.org/conf/sa98/papers/frisberg.pdf |url-status=live |archive-url=https://web.archive.org/web/20240115002036/https://www.sigada.org/conf/sa98/papers/frisberg.pdf |archive-date=15 Jan 2024 |access-date=13 Feb 2024 |website=The Special Interest Group on Ada}}</ref> [[Lockheed Martin F-22 Raptor]] and the DFCS replacement flight control system for the [[Grumman F-14 Tomcat]]. The Canadian Automated Air Traffic System was written in 1 million lines of Ada ([[Source lines of code|SLOC]] count). It featured advanced [[distributed processing]], a distributed Ada database, and object-oriented design. Ada is also used in other air traffic systems, e.g., the UK's next-generation Interim Future Area Control Tools Support ({{proper name|iFACTS}}) air traffic control system is designed and implemented using [[SPARK (programming language)|SPARK]] Ada.<ref>{{cite web|last=AdaCore|title=GNAT Pro Chosen for UK's Next Generation ATC System|url=http://www.adacore.com/2007/06/19/adacore-gnat-pro-chosen-for-uk-next-generation/|access-date=2011-03-01|archive-url=https://web.archive.org/web/20101224163518/http://www.adacore.com/2007/06/19/adacore-gnat-pro-chosen-for-uk-next-generation/|archive-date=2010-12-24|url-status=dead}}</ref>
It is also used in the [[France|French]] [[Transmission Voie-Machine|TVM]] in-[[cab signalling]] system on the [[TGV]] high-speed rail system, and the metro suburban trains in Paris, London, Hong Kong and New York City.<ref name="Ada_usage" /><ref>{{cite web|last=AdaCore|title=Look Who's Using Ada|url=http://www.adacore.com/home/ada_answers/lookwho/|access-date=2011-03-01|archive-url=https://web.archive.org/web/20101224102110/http://www.adacore.com/home/ada_answers/lookwho|archive-date=2010-12-24|url-status=dead}}</ref>
 
The Ada 95 revision of the language went beyond the Steelman requirements, targeting general-purpose systems in addition to embedded ones, and adding features supporting [[object-oriented programming]].<ref>David A. Wheeler (1997), [https://web.archive.org/web/20200914235617/https://dwheeler.com/steelman/steeltab.htm "Ada, C, C++, and Java vs. The Steelman"]. Originally published in ''Ada Letters'' July/August 1997</ref>
 
== Standardization ==
Line 81 ⟶ 92:
! Year
! Informal name
! ANSIOfficial Standard
! ISO/IEC Standard
|-
| 1980
| Ada
| ANSI MIL-STD 1815
| {{n/a}}
|-
| 1983
| Ada 83/87
| ANSI MIL-STD 1815A<br />ISO/IEC 8652:1987
| 8652:1987
|-
| 1995
| Ada 95
!| ISO/IEC Standard8652:1995
| {{n/a}}
| 8652:1995
|-
| 2007
| Ada 2005
| ISO/IEC 8652:1995/Amd 1:2007
| {{n/a}}
| 8652:1995/Amd 1:2007
|-
| 2012
| Ada 2012
| ISO/IEC 8652:2012
| {{n/a}}
| 8652:2012
|-
| 2023
| Ada 2022
| ISO/IEC 8652:2023
| {{n/a}}
| 8652:2023
|}
 
Preliminary Ada can be found in ACM Sigplan Notices Vol 14, No 6, June 1979<ref>{{cite web|url=https://dl.acm.org/doi/pdf/10.1145/956650.956651 |title=ACM Sigplan Notices |volume=14 |number= 6 |date=June 1979|pages=1–145 |doi=10.1145/956650.956651 |last1=Ichbiah |first1=J. D.}}</ref>
 
Ada was first published in 1980 as an [[American National Standards Institute|ANSI]] standard ANSI/'''MIL-STD 1815'''. As this very first version held many errors and inconsistencies ,{{Efn|see Summary of Ada Language Changes<ref>[https://dl.acm.org/doi/pdf/10.1145/989791.989792 Summary of Ada Language Changes]</ref>}}, the revised edition was published in 1983 as ANSI/MIL-STD 1815A. Without any further changes, it became an ISO standard in 1987.<ref>{{Cite web |last= |date=2013-02-21 |title=ISO 8652:1987 |url=https://www.iso.org/standard/16028.html |access-date=2024-01-19 |website=ISO |language=en}}</ref> This version of the language is commonly known as '''Ada&nbsp;83''', from the date of its adoption by ANSI, but is sometimes referred to also as '''Ada&nbsp;87''', from the date of its adoption by ISO.<ref>{{Cite web |title=Ada 83 LRM, Front Page |url=http://archive.adaic.com/standards/83lrm/html/Welcome.html |access-date=2024-01-19 |website=archive.adaic.com}}</ref> There is also a French translation; DIN translated it into German as DIN 66268 in 1988.
 
'''Ada&nbsp;95''', the joint ISO/IEC/ANSI standard ISO/IEC 8652:1995<ref>{{Cite web |last= |title=ISO/IEC 8652:1995 |url=https://www.iso.org/standard/22983.html |access-date=2024-01-19 |website=ISO |language=en}}</ref><ref>{{Cite web |title=Ada 95 Language Reference Manual (original) – Ada Resource Association |url=https://www.adaic.org/ada-resources/standards/ada-95-documents/lrm-original/ |access-date=2024-01-19 |website=www.adaic.org}}</ref> was published in February 1995, making it the first ISO standard object-oriented programming language. To help with the standard revision and future acceptance, the [[US Air Force]] funded the development of the [[GNAT]] [[Compiler]]. Presently, the GNAT Compiler is part of the [[GNU Compiler Collection]].
 
Work has continued on improving and updating the technical content of the Ada language. A Technical Corrigendum to Ada&nbsp;95 was published in October 2001,<ref>[https://www.iso.org/standard/35451.html ISO/IEC 8652:1995/Corr 1:2001]</ref><ref>[http://www.adaic.org/standards/95lrm/html/RM-TTL.html Ada 95 RM with TC 1]</ref> and a major Amendment, ISO/IEC 8652:1995/Amd 1:2007 <ref>{{Cite web |last= |title=ISO/IEC 8652:1995/Amd 1:2007 |url=https://www.iso.org/standard/45001.html |access-date=2024-01-19 |website=ISO |language=en}}</ref><ref>{{Cite web |title=Ada Reference Manual, ISO/IEC 8652:2007(E) Ed. 3 |url=https://www.adaic.org/resources/add_content/standards/05rm/html/RM-TTL.html |access-date=2024-01-19 |website=www.adaic.org}}</ref> was published on March 9, 2007, commonly known as '''Ada&nbsp;2005''' because work on the new standard was finished that year.
 
At the Ada-Europe 2012 conference in Stockholm, the Ada Resource Association (ARA) and Ada-Europe announced the completion of the design of the latest version of the Ada language and the submission of the reference manual to the [[ISO/IEC JTC 1/SC 22]]/WG 9 of the [[International Organization for Standardization]] (ISO) and the [[International Electrotechnical Commission]] (IEC) for approval. ISO/IEC 8652:2012<ref>{{Cite web |last= |date=2013-03-28 |title=ISO/IEC 8652:2012 |url=https://www.iso.org/standard/61507.html |access-date=2024-01-19 |website=ISO |language=en}}</ref> (see [https://www.adaic.org/resources/add_content/standards/12rm/html/RM-TTL.html Ada 2012 RM]) was published in December 2012, known as '''Ada&nbsp;2012'''. A technical corrigendum, ISO/IEC 8652:2012/COR 1:2016, was published <ref>{{Cite web |last= |title=ISO/IEC 8652:2012/Cor 1:2016 |url=https://www.iso.org/standard/69798.html |access-date=2024-01-19 |website=ISO |language=en}}</ref> (see [http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-TTL.html RM 2012 with TC 1]).
 
On May 2, 2023, the Ada community saw the formal approval of publication of the '''Ada&nbsp;2022''' edition of the programming language standard.<ref name="ada-letters-june2023" />
 
Despite the names Ada 83, 95 etc., legally there is only one Ada standard, the one of the last ISO/IEC standard: with the acceptance of a new standard version, the previous one becomes withdrawn. The other names are just informal ones referencing a certain edition.
 
Other related standards include [[Graphical Kernel System|ISO/IEC 8651]]-3:1988 ''Information processing systems—Computer graphics—Graphical Kernel System (GKS) language bindings—Part 3: Ada''.
Line 135 ⟶ 139:
 
=== "Hello, world!" in Ada ===
A common example of a language's [[Syntax (programming languages)|syntax]] is the [["Hello, worldWorld!" program]]:
(hello.adb)
<syntaxhighlight lang="ada" line>
Line 176 ⟶ 180:
</syntaxhighlight>
 
The predefined plus-operator can only add values of the same type, so the expression is illegal.
 
Types can be refined by declaring [[subtyping|subtypes]]:
Line 188 ⟶ 192:
</syntaxhighlight>
 
Types can have modifiers such as ''limited, abstract, private'' etc. Private types do not show their inner structure; objects of limited types cannot be copied.<ref>{{cite web |title=Ada Syntax Card |url=http://www.digilife.be/quickreferences/QRC/Ada%20Syntax%20Card.pdf |access-date=28 February 2011 |url-status=dead |archive-url=https://web.archive.org/web/20110706133825/http://www.digilife.be/quickreferences/QRC/Ada%20Syntax%20Card.pdf |archive-date=6 July 2011}}</ref> Ada 95 adds further features for object-oriented extension of types.
 
=== Control structures ===
Line 234 ⟶ 238:
 
=== Packages, procedures and functions ===
Among the parts of an Ada program are packages, procedures and functions.
 
Functions differ from procedures in that they must return a value. Function calls cannot be used "as a statement", and their result must be assigned to a variable. However, since Ada 2012, functions are not required to be pure and may mutate their suitably declared parameters or the global state.<ref>{{cite web |title=Subprograms |url=https://learn.adacore.com/courses/intro-to-ada/chapters/subprograms.html#function-calls |website=learn.adacore.com |publisher=AdaCore |access-date=14 April 2024}}</ref>
Line 280 ⟶ 284:
 
=== Pragmas ===
A pragma is a [[compiler directive]] that conveys information to the compiler to allow specific manipulating of compiled output.<ref>{{cite web |url=http://archive.adaic.com/standards/83lrm/html/lrm-02-08.html#2.8 |title=Ada 83 LRM, Sec 2.8: Pragmas |publisher=Archive.adaic.com |access-date=2014-01-27}}</ref> Certain pragmas are built into the language,<ref>{{cite web |url=http://archive.adaic.com/standards/83lrm/html/lrm-B.html |title=Ada 83 LRM, Appendix/Annex B: Predefined Language Pragmas |publisher=Archive.adaic.com |access-date=2014-01-27 |url-status=dead |archive-url=https://web.archive.org/web/20120206005541/http://archive.adaic.com/standards/83lrm/html/lrm-B.html |archive-date=2012-02-06}}</ref> while others are implementation-specific.
 
Examples of common usage of compiler pragmas would be to disable certain features, such as run-time type checking or array subscript boundary checking, or to instruct the compiler to insert object code instead of a function call (as C/C++ does with [[inline function]]s).
Line 289 ⟶ 293:
== See also ==
{{Portal|Computer programming}}
* [[List_of_compilersList of compilers#Ada_compilersAda compilers|Ada compilers]]
* {{annotated link|ALGOL 68}}
* [[APSE]] – a specification for a programming environment to support software development in Ada
* {{annotated link|APSE}}
* [[Ravenscar profile]] – a subset of the Ada tasking features designed for safety-critical hard real-time computing
* {{annotated link|Pascal (programming language)|Pascal}}
* [[SPARK (programming language)|SPARK]] – a programming language consisting of a highly restricted subset of Ada, annotated with meta-information describing desired component behavior and individual runtime requirements
* {{annotated link|Ravenscar profile}}
* [[VHDL]], Ada-based hardware description language
* {{annotated link|Smalltalk}}
* {{annotated link|SPARK (programming language)|SPARK}}
* {{annotated link|VHDL}}
 
==Notes==
Line 310 ⟶ 317:
=== Rationale ===
These documents have been published in various forms, including print.
* {{citation |url=http://archive.adaic.com/standards/83rat/html/Welcome.html |last1=Ichbiah |first1=Jean D. |author-link=Jean Ichbiah |last2=Barnes |first2=John G. P. |last3=Firth |first3=Robert J. |last4=Woodger |first4=Mike |title=Rationale for the Design of the Ada Programming Language |year=1986 |url-status=dead |archive-url=https://web.archive.org/web/20070202205233/http://archive.adaic.com/standards/83rat/html/Welcome.html |archive-date=2007-02-02}} Also available [https://apps.dtic.mil/dtic/tr/fulltext/u2/a187106.pdf apps.dtic.mil], pdf
* {{citation |url=http://www.adaic.org/resources/add_content/standards/95rat/rat95html/rat95-contents.html |last=Barnes |first=John G. P. |title=Ada 95 rationale: the language: the standard libraries |year=1995}}
* {{citation |url=http://www.adaic.org/standards/05rat/html/Rat-TTL.html |first=John |last=Barnes |title=Rationale for Ada 2005 |orig-yeardate=2005 |year=2006}}
 
=== Books ===
Line 352 ⟶ 359:
*{{cite book |editor-last=Bjørner |editor-first=Dines |editor2-last=Oest |editor2-first=Ole N. |date=1980 |title=Towards a Formal Description of Ada |publisher=Springer-Verlag |___location=London |isbn=3-540-10283-3}}
{{Refend}}
 
==Further reading==
*{{cite book |last=Barnes |first=John |author-link=John Barnes (computer scientist) |date=20142024 |title=Programming in Ada 2022 |publisher=Cambridge University Press |isbn=978-1-009-56477-9}}
*{{cite book |last=Barnes |first=John |author-link=John Barnes (computer scientist) |date=2014 |title=Programming in Ada 2012 with a Preview of Ada 2022 |publisher=Cambridge University Press |isbn=978-1-009-18134-1}}
*{{cite book |last=Barnes |first=John |author-link=John Barnes (computer scientist) |date=2014 |title=Programming in Ada 2012 |publisher=Cambridge University Press |isbn=978-1-107-42481-4}}
Line 373 ⟶ 381:
 
===== {{No more links}} ===== -->
{{Commons category|Ada (programming language)}}
{{Wikibooks|Ada Programming}}
{{Wikisourcecat|Ada|Steelman language requirements}}
{{Wikiversity|Ada}}
* [https://www.adaic.org Ada Resource Association]
Line 381 ⟶ 389:
* [https://www.open-std.org/JTC1/SC22/WG9/ JTC1/SC22/WG9 ISO home of Ada Standards]
* [http://purl.umn.edu/41474 Ada Programming Language Materials, 1981–1990]. [[Charles Babbage Institute]], University of Minnesota.
* Department of Defense (June 1978), [https://web.archive.org/web/20200914235620/https://dwheeler.com/steelman/steelman.htm Requirements for High Order Computer Programming Languages: "Steelman"]
 
* David A. Wheeler (1996), [https://web.archive.org/web/20200915104558/https://dwheeler.com/steelman/ Introduction to Steelman On-Line] (version 1.2).
* SoftTech Inc. (1976), [https://archive.org/details/DTIC_ADA037637/mode/2up "Evaluation of ALGOL 68, JOVIAL J3B, Pascal, Simula 67, and TACPOL Versus TINMAN - Requirements for a Common High Order Programming Language."] - See also: [[ALGOL 68]], [[JOVIAL]] J3B, [[Pascal (programming language)|Pascal]], [[Simula]] 67, and TACPOL (Defense Technical Information Center - DTIC ADA037637, Report Number 1021-14).
* David A. Wheeler (1997), [https://web.archive.org/web/20200914235617/https://dwheeler.com/steelman/steeltab.htm "Ada, C, C++, and Java vs. The Steelman"]. Originally published in ''Ada Letters'' July/August 1997.
 
{{Pascal programming language family}}
Line 392 ⟶ 403:
[[Category:.NET programming languages]]
[[Category:Avionics programming languages]]
[[Category:High-integrity Integrityprogramming Programming Languagelanguages]]
[[Category:Multi-paradigm programming languages]]
[[Category:Programming language standards]]
Line 402 ⟶ 413:
[[Category:High-level programming languages]]
[[Category:Ada Lovelace]]
<!-- Hidden categories below -->
[[Category:Articles with example Ada code]]