Ada,是一种
程序设计语言。源于
美国军方的一个计划,旨在整合美军系统中运行着上百种不同的程序设计语言编写的程序。
Ada 是一种结构性的程序语言, 静态类型的
命令式的 computer programming language designed by a team lead by
Jean Ichbiah of
CII Honeywell Bull during
1977–
1983. It addresses many of the same tasks as
C or
C++, but with the type-safety of a language like
Java. (Some cite Ada as an influence on Java.) Ada是以
Ada Lovelace来命名的, 通常的,她被视作是第一位计算机程序员.
目录
重要特征
ADA语言最早是针对嵌入式和实时系统设计的,并且在今天依然在这方面使用广泛. ADA95版, 是由INTERMETRICS公司的塔克.塔夫特于92到95年间设计的,当时主要是希望用于对系统,数字,财务软件的支持进行改进工作. ADA语言的重要特征就是其键入式风格, 模块化设计, 编译检查,平行任务处理,异常处理及基因编程. ADA在95年加入了面向对象设计的支持, 包括动态分配等. ADA的编译检查主要是针对没有分配的内存读写的保护, 堆栈溢出错误, 单个错误空闲, 队列读写错误以及其他可以避免的小问题. 这些检查可以在为增加效率的情况下被取消, 但是在编译的时候他们却能带来很高的效率. 同样它也包括对程序的严正的设置.因为这些原因,它被广泛应用于一些非常重要的系统中,例如航空电子学,武器及航天飞行器的操作系统中. 同样它支持很多的编译时间检查,这些检查被用来避免一些错误的发生.这种错误往往是在其他语言中在运行以前都不能被察觉到的,需要在源码中加入特殊的检查设置才能被发现. ADA的动态内存管理非常安全和高规格, 它类似于JAVA语言却不同于C语言的.这种特殊功能并不需要特殊的运行设置. 尽管这种语言的语意结构允许对于不能读写的目标进行自动的碎片搜集,但是大多数运行都不支持它. ADA却支持有限形式基于区域的存储管理. 无效的读写常在运行时候被检查出来(除非这种检测被人为关闭) 并且有时候在编译时候就被发现. ADA语言的定义同国际标准化组织(ISO)的标准有很大不同,因为他是一个自由内容形式的. 这种做法的后果是被广大程序员只能从它的标准化文档(普遍认为是ADA的参考使用手册(ARM))寻找细节性的技术问题,但是普遍情况是一本标准教科书却可以在其他不同语言上使用.
历史
在
70年代,
美国国防部 因为它所属项目的编程语言数量而倍受关注.这些语言中的很多都是完全独立于硬件的,并且其中没有一个是支持安全模块编程的.
1975年 高次阶语言工作组 (HOLWG) 终于成立了.它的主要目标就是寻找或者创造一些适合国防部需要的语言来减少这种现存的编程语言数量.它带来的结果就是ADA语言. 因此,这些编程语言数量从
1983 的450下降到了
1996的37种.
工作组开发出了语言要求文档—稻草人, 木头人, 锡人, 铁人 和
钢人 文档. 许多现存的语言都被仔细地检查,但是
1977年 这个团队却声称没有任何现存语言符合他们的条件. 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 (
CII Honeywell Bull, led by
Jean Ichbiah), Blue (
SofTech, led by
John Goodenough), and Yellow (
SRI International, led by
Jay Spitzen ). In April 1978, after public scrutiny, the Red and Green proposals passed to the next phase. In May of
1979, the Green proposal, designed by Jean Ichbiah at CII Honeywell Bull, was chosen and given the name Ada—after
Augusta Ada, Countess of Lovelace. This proposal was influenced by the 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
1987, the US Department of Defense began to require the use of Ada (the
Ada mandate) for every software project where new code was more than 30% of result, though exceptions to this rule were often granted. This requirement was effectively removed in
1997, as the DoD began to embrace COTS (
commercial off-the-shelf) technology. Similar requirements existed in other
North Atlantic Treaty Organisation countries. Because Ada is a stongly-typed language, it has been used outside the military in commercial aviation projects, where a software bug can mean fatalities. The fly-by-wire system in the
Boeing 777 runs software written in Ada. The language became an
ANSI standard in
1983 (
ANSI/MIL-STD 1815A, and without any further changes became an
ISO standard in
1987 (ISO-8652:1987). This version of the language is commonly known as Ada 83, from the date of its adoption by ANSI, but is sometimes refered also as Ada 87, from the date of its adoption by ISO. Ada 95, the joint ISO/ANSI standard (
ISO-8652:1995) is the latest standard for Ada. It was published in February
1995 (making Ada 95 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. Nowadays the GNAT Compiler is part of the
GNU Compiler Collection. Work continues on improving and updating the technical content of the Ada programming language. A Technical Corrigendum to Ada 95 was published in October
2001. Presently, more work is being done to produce the roughly once-a-decade major update to Ada, expected in late
2006 (see
official schedule). This new version is commonly known as Ada 2005, just as Ada95 was commonly known as Ada94 prior to its publication.
ADA语言的"世界,你好!" 示例程序
一个ADA语言编写的"你好世界"
Hello world program程序:
with Ada.Text_IO;
procedure Hello
isbeginAda.Text_IO.Put_Line("Hello, world!");
end Hello;
在 Ada.Text_IO.Put_Line处有一些快捷图标, 不需要很多的文字输入, 但是对于这里的理解来讲并没有多大意义. 参考细节性的问题
Wikibooks:Ada Programming/Basic.
关于阿利亚纳五号的失败
一个普遍的关于阿利亚纳五号
欧洲航天局 阿利亚纳五号 火箭失败的说法是因为ADA语言在编译过程的检查失败导致的. 在
阿利亚纳四号 中已经证明了这些检查是不需要的. 尽管广泛的检查和正确的异常处理可能导致这些问题,问题本身就是一个设计好的决定.这个决定是为了拯救计划的一部分,并且它的软件是从
阿利亚纳四号上直接拿过来使用的,并没有经过任何分析和修改.最严重的是在
阿利亚纳五号 运行的程序都没进行过测试.