Ada

Ada
编程范型多范式
設計者
  • 美國軍事規範英语United States Military StandardMIL-STD-1815/Ada 83: Jean Ichbiah英语Jean Ichbiah
  • Ada 95: Tucker Taft
  • Ada 2005: Tucker Taft
  • Ada 2012: Tucker Taft
发行时间1980年
型態系統静态强类型安全标明英语Nominal type system
操作系统跨平台
網站http://www.adaic.org/
主要實作產品
AdaCore GNAT,

Green Hills Software英语Green Hills Software Optimising Ada 95 compiler,

DDC-I英语DDC-I Score
衍生副語言
SPARK、Ravenscar profile
啟發語言
ALGOL 68, Pascal, C++(Ada 95), Smalltalk(Ada 95), Modula-2 (Ada 95) , Java(Ada 2005),Eiffel(Ada 2012)
影響語言
C++, Eiffel, PL/SQL, VHDL, Ruby, Java
Ada吉祥物

Ada,是一种程序设计语言。它源于美国国防部在二十世纪七十年代的计划,旨在整合美军系统程序设计语言,而当时美军系统运行着上百种不同的程序设计语言,并提高除錯能力和效率,由Pascal及其他语言扩展而成,接近自然語言和数学表达式,用「Ada」命名以纪念埃达·洛夫莱斯Ada Lovelace)。

重要特征

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种。

英語维基文库中相关的原始文献:
Steelman language requirements

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

Ada语言的示例程序

Hello, World!程序

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;

参见

参考书目

国际标准

  • 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

书目

維基教科書中的相關電子教程:Ada Programming
  • 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的百科

总体信息

辅助工具书

工程

参考文献

  1. ^ Technical Corrigendum for Ada 2012 published by ISO. Ada Resource Association. 2016-01-29 [2016-02-23]. (原始内容存档于2016-03-04). 
  2. ^ Consolidated Ada 2012 Language Reference Manual. Ada Conformity Assessment Authority. [2016-02-23]. (原始内容存档于2016-03-03).  |url-status=|dead-url=只需其一 (帮助)
  3. ^ Technical Corrigendum 1 for Ada 2012. Ada Conformity Assessment Authority. [2016-02-23]. (原始内容存档于2016-03-02).  |url-status=|dead-url=只需其一 (帮助)

外部链接

范型
过程式
面向对象
多范型
函数式
逻辑式
脚本语言
动态语言
Shell语言
ECMA-262
特定平台
.NET
JVM
特定领域
科学计算
GPU计算
  • Cg/HLSL
  • GLSL
  • Brook英语BrookGPU
  • OpenCL
  • CUDA/PTX英语Parallel Thread Execution
  • Futhark
  • SPIR-V英语Standard Portable Intermediate Representation
数据查询
可视化
传媒设计
 
其它
  • 分类 目录
  • 列表级条目 列表
  • 历史
  • 比较英语Comparison of programming languages
  • 时间线英语Timeline of programming languages
规范控制数据库:各地 編輯維基數據鏈接
  • 西班牙
    • 2
  • 德国
  • 以色列
  • 美国
  • 拉脱维亚
  • 捷克