Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Ada (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Features == Ada was originally designed for [[embedded system|embedded]] and [[real-time computing|real-time]] systems. The Ada 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 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 keyword 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 such 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 book |url=https://www.adaic.org/resources/add_content/docs/95style/html/sec_6/|chapter=Concurrency |title=Ada 95 Quality and Style Guide|publisher=Ada Information Clearinghouse |access-date=November 5, 2021}}</ref> Compilers also commonly check for misspelled [[identifier]]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}}</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 supports a limited form of [[region-based memory management]], and in Ada, 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;}}. A single {{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>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)