Ada
Template:NoteTA 脚本错误:没有“Infobox”这个模块。脚本错误:没有“Check for unknown parameters”这个模块。
Ada,是一种程序设计语言。它源于美国国防部在二十世纪七十年代的计划,旨在整合美军系统程序设计语言,而当时美军系统运行着上百种不同的程序设计语言,并提高除错能力和效率,由Pascal及其他语言扩展而成,接近自然语言和数学表达式,用“Ada”命名以纪念埃达·洛夫莱斯(脚本错误:没有“Lang”这个模块。)。
重要特征[编辑]
Ada语言最早针对嵌入式和实时计算设计,至今依然在这些领域广泛使用。Ada95版,是由INTERMETRICS公司的塔克·塔夫特于1992到1995年间设计的,旨在改进对于系统、数字、财务软件编程的支持。
Ada语言的重要特征就是其嵌入式风格,模块化编程,编译检查,平行处理,异常处理及泛型编程。Ada在1995年加入了对面向对象设计的支持,包括动态分配等。
Ada的编译检查主要是针对没有分配的内存读写的保护,堆栈溢出错误,单个错误空闲,队列读写错误以及其他可以避免的小问题。这些检查可以在为增加效率的情况下被取消,但是在编译的时候他们却能带来很高的效率。同样它也包括对程序的严正的设置。因为这些原因,它被广泛应用于一些非常重要的系统中,例如航空电子学,武器及航天飞行器的操作系统中。
同样它支持很多的编译时间检查,这些检查被用来避免一些错误的发生。这种错误往往是在其他语言中运行之前难以被察觉到的,需要在源码中加入特殊的检查设置才能被发现。
Ada的动态内存管理非常安全和高规格,类似于Java语言却不同于C语言的。这种特殊功能并不需要特殊的运行设置。尽管这种语言的语意结构允许对于不能读写的目标进行自动的碎片搜集,但是大多数运行时都不支持该特性。Ada却支持有限形式基于区域的存储管理。无效的读写常在运行时候被检查出来(除非这种检测被人为关闭)并且有时候在编译期就被发现。
Ada语言的定义同国际标准化组织的标准有很大不同,是一个自由内容形式的。这种做法的后果是被广大程序员只能从它的标准化文档(一般是Ada的参考使用手册)寻找细节性的技术问题,但是普遍情况是一本标准教科书却可以在其他不同语言上使用。
Ada语言由严格的巴斯特范式定义,不适合一般人阅读。它是第一种同时拥有IEC/ISO/美国军用标准认证的语言,其编译器经过严格的审查,以确保同样的代码在任一编译器上产生同样的可执行效果,并且保证并行性在代码级可以在无操作系统下同样运行。
历史[编辑]
在1970年代,美国国防部(DoD)所属的嵌入式计算机系统项目中使用的编程语言数量逐日增多,其中的很多语言十分陈旧或者依赖于硬件,而且没有一个支持安全的模块化编程,对此DoD感到十分担心。基于这个原因,在1975年成立了高级语言工作组(HOLWG),它的使命是就是寻找或者创造某种适合国防部需要的编程语言,以便减少现有编程语言数量。该小组最终的工作成果就是Ada语言。由此,类似项目中使用的高级编程语言的数量大大减少了,1983年的450种编程语言,到1996年只剩下37种。
Template:Sister工作组开发出了语言要求文档—文档。许多现存的语言都被仔细地检查,但是1977年这个团队声称没有任何现存语言符合他们的条件。
应用[编辑]
1994年,中国已将Ada作为军事领域的标准语言,并将使用Ada构建北京空中交通管制系统。[1]
Ada语言的示例程序[编辑]
with Ada.Text_IO; use Ada.Text_IO;
procedure Hello is
begin
Put_Line("Hello, world!");
end Hello;
在Ada.Text_IO.Put_Line处有一些捷径,不需要很多的文字输入,但是对于这里的理解来讲并没有多大意义。细节性的问题请参考Ada Programming/Basic。
判定一个字符串是否为回文的函数(递归):
-- 判定一个字符串是否是回文
function is_palindrome(str : in String) return Boolean is
len : Natural := str'Length;
begin
if len <= 1 then
return True;
elsif Element(To_Unbounded_String(str), 1) = Element(To_Unbounded_String(str), len) then
declare
new_str : String(1..len-2);
begin
new_str := Slice(Source => To_Unbounded_String(str),
Low => 2,
High => len - 1);
return is_palindrome(str => new_str);
end;
else
return False;
end if;
end is_palindrome;
定义一个函数用来判定一字符串是否为回文:
-- 判定一个字符串是否是回文
function is_palindrome(str : in String) return Boolean is
len : Natural := str'Length;
begin
for i in 1 .. len / 2 loop
if Element(To_Unbounded_String(str), i) /= Element(To_Unbounded_String(str), len - i + 1)
then
return False;
end if;
end loop;
return True;
end is_palindrome;
参见[编辑]
参考书目[编辑]
国际标准[编辑]
- Template:Tsl:Information technology — Programming languages — Ada
- Template:Tsl:Information technology — Programming languages — Ada Semantic Interface Specification(ASIS)
- Template:Tsl: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
- Template:Tsl:Programming in Ada plus Language Reference Manual, Addison-Wesley, ISBN 0-201-56539-0
- Template:Tsl:Programming in Ada 95, Addison-Wesley, ISBN 0-201-34293-6
- Template:Tsl:High Integrity Ada: The SPARK Approach, Addison-Wesley, ISBN 0-201-17517-7
- Template:Tsl:High Integrity Software: The SPARK Approach to Safety and Security, Addison-Wesley, ISBN 0-321-13616-0
- Template:Tsl:Ada Programmer's Handbook, Benjamin-Cummings Publishing Company, ISBN 0-8053-2529-8
- Template:Tsl:Ada for Software Engineers, John Wiley & Sons, ISBN 0-471-97912-0
- Template:Tsl:Ada as a Second Language, McGraw-Hill Science/Engineering/Math, ISBN 0-07-011607-5
- Template:Tsl,Template:Tsl:Real-Time Systems and Programming Languages. Ada 95, Real-Time Java and Real-Time POSIX., Addison-Wesley, ISBN 0-201-72988-1
- Template:Tsl,Template:Tsl:Concurrency in Ada, Cambridge University Press, ISBN 0-521-62911-X
- Template:Tsl:Object-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
- Template:Tsl,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
- Template:Tsl,Fintan Culwin:Ada 95 the Craft of Object Oriented Programming, Prentice Hall, ISBN 0-13-230350-7
- Template:Tsl:Ada 95, Springer-Verlag, ISBN 0-387-94801-5
- David R. Musser,Template:Tsl:The 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
- Template:Tsl:Ada95 for C and C++ Programmers, Addison-Wesley, ISBN 0-201-40363-3
- Michael B. Feldman,Template:Tsl:Ada 95, Addison-Wesley, ISBN 0-201-36123-X
- Nell Dale,Chip Weems,Template:Tsl:Programming and Problem Solving with Ada 95, Jones & Bartlett Publishers, ISBN 0-7637-0293-5
- Nell Dale,Susan Lilly,Template:Tsl:Ada 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
- Template:Tsl:Introduction 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
- Template:Tsl,Template:Tsl:HRT-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 ProgrammingTemplate:Wayback
- Programación en AdaTemplate:Wayback
- Programmation AdaTemplate:Wayback
工程[编辑]
- AdaCLTemplate:Wayback
- wikibook-adaTemplate:Wayback
- ASISTemplate:Wayback
- GLADETemplate:Wayback
- FloristTemplate:Wayback
参考文献[编辑]
外部链接[编辑]
- Ada World
- AdaPowerTemplate:Wayback
- The Web Site for AdaTemplate:Wayback
- ACM SIGAdaTemplate:Wayback
- Ada-Europe OrganizationTemplate:Wayback
- Ada Information ClearinghouseTemplate:Wayback
- ISO Home of Ada StandardsTemplate:Wayback
- Ada 95 Books Available OnlineTemplate:Wayback
- Ada Rapporteur Group (evolution of standard)Template:Wayback
- Ada Answers - Building better software with AdaTemplate:Wayback
- Ada Academic Initiative
- "Libre" Ada SoftwareTemplate:Wayback
- GNU Ada HomepageTemplate:Wayback
- GNAVI Ada Visual RADTemplate:Wayback
- Citations from CiteSeerTemplate:Wayback
- GNATTemplate:Wayback
- AdaGIDE, the Ada GNAT Integrated Development Environment for Windows
- Forum
- Ada Tutorial
- Projects Using AdaTemplate:Wayback
- A#: Ada on .NETTemplate:Wayback
- Conference announcements for the international Ada communityTemplate:Wayback
脚本错误:没有“Navbox”这个模块。