Ada

























































Ada
编程范型
多范式
設計者





  • 美國軍事規範英语United States Military StandardMIL-STD-1815/Ada 83: Jean Ichbiah

  • Ada 95: Tucker Taft

  • Ada 2005: Tucker Taft


发行时间
1980年

穩定版本
Ada 2005
( 2007年,​11年前​(2007


預覽版本
Ada 2012[1]
( 2010年9月,​8年前​(2010-09


型態系統
静态、强、安全、标明
作業系統
跨平台
網站
http://www.adaic.org/
主要實作產品

AdaCore GNAT,
Green Hills Software Optimising Ada 95 compiler,


DDC-I Score
衍生副語言

SPARK、Ravenscar profile
啟發語言

ALGOL 68, Pascal, C++(Ada 95), Smalltalk(Ada 95), Java(Ada 2005)
影響語言

C++, Eiffel, PL/SQL, VHDL, Ruby, Java


  • 維基教科書中有關Ada Programming的文本


Ada,是一种程序设计语言。它源于美国军方的一个计划,旨在整合美军系统中运行着上百种不同的程序设计语言编写的程序,並提高除錯能力與效率,由Pascal及其他語言擴展而成,比較接近自然語言和數學表達式,並用「Ada」命名以紀念埃达·洛夫莱斯(Ada Lovelace)。




目录






  • 1 重要特征


  • 2 历史


  • 3 Ada语言的“Hello, World!”示例程序


  • 4 关于阿丽亚娜5型运载火箭的失败


  • 5 参见


  • 6 参考书目


    • 6.1 国际标准


    • 6.2 书目




  • 7 Ada的百科


    • 7.1 总体信息


    • 7.2 辅助工具书


    • 7.3 工程




  • 8 注释


  • 9 外部链接





重要特征


Ada语言最早是针对嵌入式和实时系统设计的,并且在现今依然在这些方面广泛使用。Ada95版,是由INTERMETRICS公司的塔克·塔夫特于1992到1995年间设计的,当时主要是希望改进对于系统、数字、财务软件编程的支持。


Ada语言的重要特征就是其嵌入式风格,模块化设计,编译检查,平行处理,异常处理及泛型编程。Ada在1995年加入了对面向对象设计的支持,包括动态分配等。


Ada的编译检查主要是针对没有分配的内存读写的保护,堆栈溢出错误,单个错误空闲,队列读写错误以及其他可以避免的小问题。这些检查可以在为增加效率的情况下被取消,但是在编译的时候他们却能带来很高的效率。同样它也包括对程序的严正的设置。因为这些原因,它被广泛应用于一些非常重要的系统中,例如航空电子学,武器及航天飞行器的操作系统中。


同样它支持很多的编译时间检查,这些检查被用来避免一些错误的发生。这种错误往往是在其他语言中运行之前难以被察觉到的,需要在源码中加入特殊的检查设置才能被发现。


Ada的动态内存管理非常安全和高规格,它类似于JAVA语言却不同于C语言的。这种特殊功能并不需要特殊的运行设置。尽管这种语言的语意结构允许对于不能读写的目标进行自动的碎片搜集,但是大多数运行都不支持它。Ada却支持有限形式基于区域的存储管理。无效的读写常在运行时候被检查出来(除非这种检测被人为关闭)并且有时候在编译时候就被发现。


Ada语言的定义同国际标准化组织(ISO)的标准有很大不同,因为他是一个自由内容形式的。这种做法的后果是被广大程序员只能从它的标准化文档(普遍认为是Ada的参考使用手册(ARM))寻找细节性的技术问题,但是普遍情况是一本标准教科书却可以在其他不同语言上使用。


Ada语言由严格的巴斯特范式定义,但是不适合一般人阅读。它是第一种同时拥有IEC/ISO/美国军用标准认证的语言,其编译器经过严格的审查,以确保同样的代码在任一编译器上产生同样的可执行效果,并且保证并行性在代码级可以在无操作系统下同样运行。



历史


在1970年代,美国国防部(DoD)所属的嵌入式计算机系统项目中使用的编程语言数量逐日增多,其中的很多语言十分陈旧或者依赖于硬件,而且没有一个支持安全的模块化编程,对此DoD感到十分担心。基于这个原因,在1975年成立了高级语言工作组(HOLWG),它的使命是就是寻找或者创造某种适合国防部需要的编程语言,以便减少现有编程语言数量。该小组最终的工作成果就是Ada语言。由此,类似项目中使用的高级编程语言的数量大大减少了,1983年的450种编程语言,到1996年只剩下37种。






工作组开发出了语言要求文档—文档。许多现存的语言都被仔细地检查,但是1977年这个团队却声称没有任何现存语言符合他们的条件。



Ada语言的“Hello, World!”示例程序


一个Ada语言编写的Hello, World!程序:


with Ada.Text_IO; 

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

Ada.Text_IO.Put_Line处有一些捷径,不需要很多的文字输入,但是对于这里的理解来讲并没有多大意义。细节性的问题請参考Ada Programming/Basic。



关于阿丽亚娜5型运载火箭的失败



一个普遍的关于欧洲空间局阿丽亚娜5型运载火箭失败的说法是因为Ada语言在编译过程的检查失败导致的。将大的浮点数转换成整数是一种常见的程序错误来源。1996年6月4日,对于阿丽亚娜5型运载火箭的初次航行来说,这样一个错误产生了灾难性的后果。发射后仅仅37秒,火箭偏离它的飞行路径,解体并爆炸了。火箭上载有价值5亿美元的通信卫星。6亿美元付之一炬。后来的调查显示,控制惯性导航系统的计算机向控制引擎喷嘴的计算机发送了一个无效数据。失事调查报告指出,火箭爆炸是因为:
.mw-parser-output .templatequote{margin-top:0;overflow:hidden}.mw-parser-output .templatequote .templatequotecite{line-height:1em;text-align:left;padding-left:2em;margin-top:0}.mw-parser-output .templatequote .templatequotecite cite{font-size:small}



During execution of a data conversion from 64-bit floating point to 16-bit signed integer value, the floating point number which was converted had a value greater than what could be represented by a 16-bit signed integer. This resulted in an Operand Error.



它没有发送飞行控制信息,而是送出了一个诊断位模式,表明在将一个64位浮点数转换成16位有符号整数时,产生了溢出。溢出值测量的是火箭的水平速率,这比早先的阿丽亚娜4型运载火箭所能达到的高出了5倍。在设计阿丽亚娜4型运载火箭的软件时,他们小心地分析了数字值,并且确定水平速率绝不会超出一个16位的数。不幸的是,他们在阿丽亚娜5型运载火箭的系统中简单地重新使用了这一部分,而没有检查它所基于的假设。Ada代码如下:


begin
sensor_get(vertical_veloc_sensor);
sensor_get(horizontal_veloc_sensor);
vertical_veloc_bias := integer(vertical_veloc_sensor);
horizontal_veloc_bias := integer(horizontal_veloc_sensor);
...
exception
when numeric_error => calculate_vertical_veloc();
when others => use_irs1();
end;


参见



参考书目



国际标准




  • ISO/IEC 8652英语ISO 8652:Information technology — Programming languages — Ada


  • ISO/IEC 15291英语ISO 15291:Information technology — Programming languages — Ada Semantic Interface Specification(ASIS)


  • ISO/IEC 18009英语ISO 18009:Information technology — Programming languages — Ada: Conformity assessment of a language processor(ACATS)


  • IEEE Standard 1003.5b-1996,the POSIX Ada binding


  • Ada Language Mapping Specification,the CORBA IDL to Ada mapping



书目








  • Jan Skansholm:Ada 95 From the Beginning, Addison-Wesley, ISBN 0-201-40376-5


  • John Barnes英语John Barnes (computer scientist)Programming in Ada plus Language Reference Manual, Addison-Wesley, ISBN 0-201-56539-0


  • John Barnes英语John Barnes (computer scientist)Programming in Ada 95, Addison-Wesley, ISBN 0-201-34293-6


  • John Barnes英语John Barnes (computer scientist)High Integrity Ada: The SPARK Approach, Addison-Wesley, ISBN 0-201-17517-7


  • John Barnes英语John Barnes (computer scientist)High Integrity Software: The SPARK Approach to Safety and Security, Addison-Wesley, ISBN 0-321-13616-0


  • Dean W. Gonzalez英语Dean W. GonzalezAda Programmer's Handbook, Benjamin-Cummings Publishing Company, ISBN 0-8053-2529-8


  • M. Ben-Ari英语M. Ben-AriAda for Software Engineers, John Wiley & Sons, ISBN 0-471-97912-0


  • Norman Cohen英语Norman CohenAda as a Second Language, McGraw-Hill Science/Engineering/Math, ISBN 0-07-011607-5


  • Alan Burns英语Alan BurnsAndy Wellings英语Andy WellingsReal-Time Systems and Programming Languages. Ada 95, Real-Time Java and Real-Time POSIX., Addison-Wesley, ISBN 0-201-72988-1


  • Alan Burns英语Alan BurnsAndy Wellings英语Andy WellingsConcurrency in Ada, Cambridge University Press, ISBN 0-521-62911-X


  • Colin Atkinson英语Colin AtkinsonObject-Oriented Reuse, Concurrency and Distribution: An Ada-Based Approach, Addison-Wesley, ISBN 0-201-56527-7


  • Grady Booch,Doug Bryan:Software Engineering with Ada, Addison-Wesley, ISBN 0-8053-0608-0


  • Daniel Stubbs英语Daniel Stubbs,Neil W. Webre:Data Structures with Abstract Data Types and Ada, Brooks Cole, ISBN 0-534-14448-9


  • Pascal Ledru:Distributed Programming in Ada with Protected Objects, Dissertation.com, ISBN 1-58112-034-6


  • Fintan Culwin:Ada, a Developmental Approach, Prentice Hall, ISBN 0-13-264680-3


  • John English英语John English,Fintan Culwin:Ada 95 the Craft of Object Oriented Programming, Prentice Hall, ISBN 0-13-230350-7


  • David A. Wheeler英语David A. WheelerAda 95, Springer-Verlag, ISBN 0-387-94801-5


  • David R. Musser,Alexander Stepanov英语Alexander StepanovThe Ada Generic Library: Linear List Processing Packages, Springer-Verlag, ISBN 0-387-97133-5


  • Michael B. Feldman:Software Construction and Data Structures with Ada 95, Addison-Wesley, ISBN 0-201-88795-9


  • Simon Johnston英语Simon JohnstonAda95 for C and C++ Programmers, Addison-Wesley, ISBN 0-201-40363-3


  • Michael B. Feldman,Elliot B. Koffman英语Elliot B. KoffmanAda 95, Addison-Wesley, ISBN 0-201-36123-X


  • Nell Dale,Chip Weems,John McCormick英语John McCormickProgramming and Problem Solving with Ada 95, Jones & Bartlett Publishers, ISBN 0-7637-0293-5


  • Nell Dale,Susan Lilly,John McCormick英语John McCormickAda Plus Data Structures: An Object-Based Approach, Jones & Bartlett Publishers, ISBN 0-669-41676-2


  • Bruce C. Krell:Developing With Ada: Life-Cycle Methods, Bantam Dell Pub Group, ISBN 0-553-09102-6


  • Judy Bishop:Distributed Ada: Developments and Experiences, Cambridge University Press, ISBN 0-521-39251-9


  • Bo Sanden:Software Systems Construction With Examples in Ada, Prentice Hall, ISBN 0-13-030834-X


  • Bruce Hillam:Introduction to Abstract Data Types Using Ada, Prentice Hall, ISBN 0-13-045949-6


  • David Rudd英语David RuddIntroduction to Software Design and Development With Ada, Brooks Cole, ISBN 0-314-02829-3


  • Ian C. Pyle:Developing Safety Systems: A Guide Using Ada, Prentice Hall, ISBN 0-13-204298-3


  • Louis Baker:Artificial Intelligence With Ada, McGraw-Hill, ISBN 0-07-003350-1


  • Alan Burns英语Alan BurnsAndy Wellings英语Andy WellingsHRT-HOOD: A Structured Design Method for Hard Real-Time Ada Systems, North-Holland, ISBN 0-444-82164-3


  • Walter Savitch, Charles Peterson:Ada: An Introduction to the Art and Science of Programming, Benjamin-Cummings Publishing Company, ISBN 0-8053-7070-6


  • Mark Allen Weiss:Data Structures and Algorithm Analysis in Ada, Benjamin-Cummings Publishing Company, ISBN 0-8053-9055-3



Ada的百科



总体信息


  • Ada@Krischik


辅助工具书



  • Ada Programming

  • Programación en Ada

  • Programmation Ada



工程



  • AdaCL

  • wikibook-ada

  • ASIS

  • GLADE

  • Florist



注释




  1. ^ Ada 2012 Language Reference Manual (Draft)



外部链接



  • Ada World

  • AdaPower

  • The Web Site for Ada

  • ACM SIGAda

  • Ada-Europe Organization

  • Ada Information Clearinghouse

  • ISO Home of Ada Standards

  • Ada 95 Books Available Online

  • Ada Rapporteur Group (evolution of standard)

  • Ada Answers - Building better software with Ada

  • Ada Academic Initiative

  • "Libre" Ada Software

  • GNU Ada Homepage

  • GNAVI Ada Visual RAD

  • Citations from CiteSeer

  • GNAT

  • AdaGIDE, the Ada GNAT Integrated Development Environment for Windows

  • Forum

  • Ada Tutorial

  • Projects Using Ada

  • A#: Ada on .NET

  • Conference announcements for the international Ada community









Popular posts from this blog

澳門輕軌系統

水泉澳邨

Indian Forest Service