Ada 编程语言
以下內容摘自wiki,http://zh.wikipedia.org/wiki/Ada
Ada,是一種程序設計語言。源于美國軍方的一個計劃,旨在整合美軍系統中運行著上百種不同的程序設計語言編寫的程序,命名是為了紀念愛達·勒芙蕾絲而使用Ada。
目錄[隱藏]
|
[編輯] 重要特征
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種。
維基文庫中相關的原始文獻: en:Steelman language requirements http://zh.wikisource.org/wiki/en:Steelman language requirements工作組開發出了語言要求文檔—文檔。許多現存的語言都被仔細地檢查,但是1977年 這個團隊卻聲稱沒有任何現存語言符合他們的條件。
[編輯] Ada語言的"世界,你好!" 示例程序
一個Ada語言編寫的"你好世界"Hello world program程序:
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。
[編輯] 關于阿利亞納五號的失敗
一個普遍的關于歐洲航天局阿利亞納五號火 箭失敗的說法是因為 Ada 語言在編譯過程的檢查失敗導致的。 將大的浮點數轉換成整數是一種常見的程序錯誤來源。1996年6月4日,對于Ariane 5火箭的初次航行來說,這樣一個錯誤產生了災難性的后果。發射后僅僅37秒,火箭偏離它的飛行路徑,解體并爆炸了。火箭上載有價值5億美元的通信衛星。6 億美元付之一炬。后來的調查顯示,控制慣性導航系統的計算機向控制引擎噴嘴的計算機發送了一個無效數據。失事調查報告指出,火箭爆炸是因為:
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位有符號整數時,產生了溢出。 溢出值測量的是火箭的水平速率,這比早先的Ariane 4火箭所能達到的高出了5倍。在設計阿利亞納4火箭的軟件時,他們小心地分析了數字值,并且確定水平速率絕不會超出一個16位的數。不幸的是,他們在阿利 亞納5火箭的系統中簡單地重新使用了這一部分,而沒有檢查它所基于的假設。Ada代碼如下:
beginsensor_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:Information technology — Programming languages — Ada
- ISO/IEC 15291:Information technology — Programming languages — Ada Semantic Interface Specification(ASIS)
- ISO/IEC 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:Programming in Ada plus Language Reference Manual, Addison-Wesley, ISBN 0-201-56539-0
- John Barnes:Programming in Ada 95, Addison-Wesley, ISBN 0-201-34293-6
- John Barnes:High Integrity Ada: The SPARK Approach, Addison-Wesley, ISBN 0201175177
- John Barnes:High Integrity Software: The SPARK Approach to Safety and Security, Addison-Wesley, ISBN 0-321-13616-0
- Dean W. Gonzalez:Ada Programmer's Handbook, Benjamin-Cummings Publishing Company, ISBN 0805325298
- M. Ben-Ari:Ada for Software Engineers, John Wiley & Sons, ISBN 0-471-97912-0
- Norman Cohen:Ada as a Second Language, McGraw-Hill Science/Engineering/Math, ISBN 0-0-7011607-5
- Alan Burns,Andy Wellings:Real-Time Systems and Programming Languages. Ada 95, Real-Time Java and Real-Time POSIX., Addison-Wesley, ISBN 0-201-72988-1
- Alan Burns,Andy Wellings:Concurrency in Ada, Cambridge University Press, ISBN 0-521-62911-X
- Colin Atkinson:Object-Oriented Reuse, Concurrency and Distribution: An Ada-Based Approach, Addison-Wesley, ISBN 0201565277
- Grady Booch,Doug Bryan:Software Engineering with Ada, Addison-Wesley, ISBN 0805306080
- 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 0132646803
- John English,Fintan Culwin:Ada 95 the Craft of Object Oriented Programming, Prentice Hall, ISBN 0-1-3230350-7
- David A. Wheeler:Ada 95, Springer-Verlag, ISBN 0-387-94801-5
- David R. Musser,Alexander Stepanov:The Ada Generic Library: Linear List Processing Packages, Springer-Verlag, ISBN 0387971335
- Michael B. Feldman:Software Construction and Data Structures with Ada 95, Addison-Wesley, ISBN 0201887959
- Simon Johnston:Ada95 for C and C++ Programmers, Addison-Wesley, ISBN 0201403633
- Michael B. Feldman,Elliot B. Koffman:Ada 95, Addison-Wesley, ISBN 0-201-36123-X
- Nell Dale,Chip Weems,John McCormick:Programming and Problem Solving with Ada 95, Jones & Bartlett Publishers, ISBN 0763702935
- Nell Dale,Susan Lilly,John McCormick:Ada Plus Data Structures: An Object-Based Approach, Jones & Bartlett Publishers, ISBN 0669416762
- Bruce C. Krell:Developing With Ada: Life-Cycle Methods, Bantam Dell Pub Group, ISBN 0553091026
- 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 013030834X
- Bruce Hillam:Introduction to Abstract Data Types Using Ada, Prentice Hall, ISBN 0130459496
- David Rudd:Introduction to Software Design and Development With Ada, Brooks Cole, ISBN 0314028293
- Ian C. Pyle:Developing Safety Systems: A Guide Using Ada, Prentice Hall, ISBN 0132042983
- Louis Baker:Artificial Intelligence With Ada, McGraw-Hill, ISBN 0070033501
- Alan Burns,Andy Wellings:HRT-HOOD: A Structured Design Method for Hard Real-Time Ada Systems, North-Holland, ISBN 0444821643
- Walter Savitch, Charles Peterson:Ada: An Introduction to the Art and Science of Programming, Benjamin-Cummings Publishing Company, ISBN 0805370706
- Mark Allen Weiss:Data Structures and Algorithm Analysis in Ada, Benjamin-Cummings Publishing Company, ISBN 0805390553
[編輯] Ada的百科
[編輯] 總體信息
- Ada@Krischik
[編輯] 輔助工具書
- Ada Programming
- Programación en Ada
- Programmation Ada
[編輯] 工程
- AdaCL
- wikibook-ada
- ASIS
- GLADE
- Florist
[編輯] 注釋
[編輯] 外部連接
- Ada World
- AdaPower
- 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
補充說明:Ada語言很適合嵌入式應用,高安全性,應該值得關注!
請參照這個站點:www.Ada-tech.com,這個套件包括Ada語言的編譯器及相應的開發文檔和各種工具。
中文Ada語言資源網:http://go8.163.com/wkh/
一個教程的中文站:http://all.163.com/it/school/apl/
總結
- 上一篇: Meta 财报发布在即,分析师称 Sna
- 下一篇: ROG 推出新款枪神 7 Plus 超竞