版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、ISBN 0-321-49362-1 Chapter 2Chapter 2Evolution of the Major Programming Languages主要程序设计语言的发展孟小亮孟小亮 : 1920525866 : 19205258661-2Chapter 2 TopicsZuses PlankalklMinimal Hardware Programming: PseudocodesThe IBM 704 and FortranFunctional Programming: LISPThe First Step Toward Sophistication: ALGOL 60Comp
2、uterizing Business Records: COBOLThe Beginnings of Timesharing: BASIC1-3Chapter 2 Topics (continued)Everything for Everybody: PL/ITwo Early Dynamic Languages: APL and SNOBOLThe Beginnings of Data Abstraction: SIMULA 67Orthogonal Design: ALGOL 68Some Early Descendants of the ALGOLsProgramming Based o
3、n Logic: PrologHistorys Largest Design Effort: Ada1-4Chapter 2 Topics (continued)Object-Oriented Programming: SmalltalkCombining Imperative ad Object-Oriented Features: C+An Imperative-Based Object-Oriented Language: JavaScripting LanguagesA C-Based Language for the New Millennium: C#Markup/Programm
4、ing Hybrid Languages1-5Genealogy of Common Languages1-6Zuses Plankalkl Designed in 1945, but not published until 1972 Never implemented Advanced data structures floating point, arrays, records Invariants1-7Plankalkl Syntax An assignment statement to assign the expression A4 + 1 to A5 | A + 1 = A V |
5、 4 5 (subscripts) S | 1.n 1.n (data types)1-8Minimal Hardware Programming: Pseudocodes What was wrong with using machine code? Poor readability Poor modifiability Expression coding was tedious Machine deficiencies-no indexing or floating point1-9Pseudocodes: Short Code Short Code developed by Mauchl
6、y in 1949 for BINAC computers Expressions were coded, left to right Example of operations: 01 06 abs value 1n (n+2)nd power 02 ) 07 + 2n (n+2)nd root03 = 08 pause 4n if = n04 / 09 ( 58 print and tab1-10Pseudocodes: Speedcoding Speedcoding developed by Backus in 1954 for IBM 701 Pseudo ops for arithm
7、etic and math functions Conditional and unconditional branching Auto-increment registers for array access Slow! Only 700 words left for user program1-11Pseudocodes: Related Systems The UNIVAC Compiling System Developed by a team led by Grace Hopper Pseudocode expanded into machine code David J. Whee
8、ler (Cambridge University) developed a method of using blocks of re-locatable addresses to solve the problem of absolute addressing1-12IBM 704 and Fortran Fortran 0: 1954 - not implemented Fortran I:1957 Designed for the new IBM 704, which had index registers and floating point hardware - This led t
9、o the idea of compiled programming languages, because there was no place to hide the cost of interpretation (no floating-point software) Environment of development Computers were small and unreliable Applications were scientific No programming methodology or tools Machine efficiency was the most imp
10、ortant concern1-13Design Process of Fortran Impact of environment on design of Fortran I No need for dynamic storage Need good array handling and counting loops No string handling, decimal arithmetic, or powerful input/output (for business software)1-14Fortran I Overview First implemented version of
11、 Fortran Names could have up to six characters Post-test counting loop (DO) Formatted I/O User-defined subprograms Three-way selection statement (arithmetic IF) No data typing statements1-15Fortran I Overview (continued) First implemented version of FORTRAN No separate compilation Compiler released
12、in April 1957, after 18 worker-years of effort Programs larger than 400 lines rarely compiled correctly, mainly due to poor reliability of 704 Code was very fast Quickly became widely used1-16Fortran II Distributed in 1958 Independent compilation (主要指子程序的单独编译) Fixed the bugs1-17Fortran IV Evolved du
13、ring 1960-62 Explicit type declarations Logical selection statement Subprogram names could be parameters ANSI standard in 1966 (美国国家标准学会 )1-18Fortran 77 Became the new standard in 1978 Character string handling Logical loop control statement IF-THEN-ELSE statement1-19Fortran 90 Most significant chan
14、ges from Fortran 77 Modules Dynamic arrays Pointers Recursion CASE statement Parameter type checking1-20Latest versions of Fortran Fortran 95 relatively minor additions, plus some deletions Fortran 2019 ditto Fortran 2019 - ditto1-21Fortran Evaluation Highly optimizing compilers (all versions before
15、 90) Types and storage of all variables are fixed before run time Dramatically changed forever the way computers are used Characterized as the lingua franca(通用语言) of the computing world1-22Functional Programming: LISP LISt Processing language Designed at MIT by McCarthy AI research needed a language
16、 to Process data in lists (rather than arrays) Symbolic computation (rather than numeric) Only two data types: atoms and lists Syntax is based on lambda calculus微积分,最早的举例就是微分代数表达式)1-23Representation of Two LISP ListsRepresenting the lists (A B C D)and (A (B C) D (E (F G)1-24LISP Evaluation Pioneered
17、 functional programming No need for variables or assignment Control via recursion and conditional expressions Still the dominant language for AI COMMON LISP and Scheme are contemporary dialects of LISP MetaLanguage, Miranda, and Haskell are related languages1-25Scheme Developed at MIT in mid 1970s S
18、mall Extensive use of static scoping Functions as first-class entities Simple syntax (and small size) make it ideal for educational applications1-26COMMON LISP An effort to combine features of several dialects of LISP into a single language Large, complex1-27The First Step Toward Sophistication: ALG
19、OL 60 (迈向成熟的第一步) Environment of development FORTRAN had (barely) arrived for IBM 70 x Many other languages were being developed, all for specific machines No portable language; all were machine- dependent No universal language for communicating algorithms ALGOL 60 was the result of efforts to design
20、 a universal language1-28Early Design Process ACM计算机协会) and GAMM应用数学和力学社团) met for four days for design (May 27 to June 1, 1958) Goals of the language Close to mathematical notation Good for describing algorithms Must be translatable to machine code1-29ALGOL 58 Concept of type was formalized Names c
21、ould be any length Arrays could have any number of subscripts Parameters were separated by mode (in & out) Subscripts were placed in brackets Compound statements (begin . end) Semicolon as a statement separator Assignment operator was := if had an else-if clause No I/O - “would make it machine d
22、ependent”1-30ALGOL 58 Implementation Not meant to be implemented, but variations of it were (MAD, JOVIAL) Although IBM was initially enthusiastic, all support was dropped by mid 19591-31ALGOL 60 Overview Modified ALGOL 58 at 6-day meeting in Paris New features Block structure (local scope) Two param
23、eter passing methods Subprogram recursion Stack-dynamic arrays Still no I/O and no string handling1-32ALGOL 60 Evaluation Successes It was the standard way to publish algorithms for over 20 years All subsequent imperative languages are based on it First machine-independent language First language wh
24、ose syntax was formally defined (BNF)1-33ALGOL 60 Evaluation (continued) Failure Never widely used, especially in U.S. Reasons Lack of I/O and the character set made programs non-portable Too flexible-hard to implement Entrenchment of Fortran Formal syntax description Lack of support from IBM1-34Com
25、puterizing Business Records: COBOL Environment of development UNIVAC was beginning to use FLOW-MATIC USAF was beginning to use AIMACO IBM was developing COMTRAN1-35COBOL Historical Background Based on FLOW-MATIC FLOW-MATIC features Names up to 12 characters, with embedded hyphens English names for a
26、rithmetic operators (no arithmetic expressions) Data and code were completely separate The first word in every statement was a verb1-36COBOL Design Process First Design Meeting (Pentagon) - May 1959 Design goals Must look like simple English Must be easy to use, even if that means it will be less po
27、werful Must broaden the base of computer users Must not be biased by current compiler problems Design committee members were all from computer manufacturers and DoD branches Design Problems: arithmetic expressions? subscripts? Fights among manufacturers1-37COBOL Evaluation Contributions First macro
28、facility in a high-level language Hierarchical data structures (records) Nested selection statements Long names (up to 30 characters), with hyphens Separate data division1-38COBOL: DoD Influence First language required by DoD would have failed without DoD Still the most widely used business applicat
29、ions language1-39The Beginning of Timesharing: BASIC Designed by Kemeny & Kurtz at Dartmouth Design Goals: Easy to learn and use for non-science students Must be “pleasant and friendly” Fast turnaround for homework Free and private access User time is more important than computer time Current po
30、pular dialect: Visual BASIC First widely used language with time sharing (分时性,多人使用同一台计算机) 1-402.8 Everything for Everybody: PL/I Designed by IBM and SHARE Computing situation in 1964 (IBMs point of view) Scientific computing IBM 1620 and 7090 computers FORTRAN SHARE user group Business computing IBM
31、 1401, 7080 computers COBOL GUIDE user group1-41PL/I: Background By 1963 Scientific users began to need more elaborate I/O, like COBOL had; business users began to need floating point and arrays for MIS It looked like many shops would begin to need two kinds of computers, languages, and support staf
32、f-too costly The obvious solution Build a new computer to do both kinds of applications Design a new language to do both kinds of applications1-42PL/I: Design Process Designed in five months by the 3 X 3 Committee Three members from IBM, three members from SHARE Initial concept An extension of Fortr
33、an IV Initially called NPL (New Programming Language) Name changed to PL/I in 19651-43PL/I: Evaluation PL/I contributions First unit-level concurrency First exception handling Switch-selectable recursion First pointer data type First array cross sections Concerns Many new features were poorly design
34、ed Too large and too complex1-44Two Early Dynamic Languages: APL and SNOBOL Characterized by dynamic typing and dynamic storage allocation Variables are untyped A variable acquires a type when it is assigned a value Storage is allocated to a variable when it is assigned a value1-45APL: A Programming
35、 Language Designed as a hardware description language at IBM by Ken Iverson around 1960 Highly expressive (many operators, for both scalars and arrays of various dimensions) Programs are very difficult to read Still in use; minimal changes1-46SNOBOLString Orientated Symbolic Language) Designed as a
36、string manipulation language at Bell Labs by Farber, Griswold, and Polensky in 1964 Powerful operators for string pattern matching Slower than alternative languages (and thus no longer used for writing editors) Still used for certain text processing tasks1-47The Beginning of Data Abstraction: SIMULA
37、 67 Designed primarily for system simulation in Norway by Nygaard and Dahl Based on ALGOL 60 and SIMULA I Primary Contributions Coroutines - a kind of subprogram Classes, objects, and inheritance1-48Orthogonal Design: ALGOL 68 From the continued development of ALGOL 60 but not a superset of that lan
38、guage Source of several new ideas (even though the language itself never achieved widespread use) Design is based on the concept of orthogonality A few basic concepts, plus a few combining mechanisms1-49ALGOL 68 Evaluation Contributions User-defined data structures Reference types Dynamic arrays (ca
39、lled flex arrays) Comments Less usage than ALGOL 60 Had strong influence on subsequent languages, especially Pascal, C, and Ada1-50Pascal - 1971 Developed by Wirth (a former member of the ALGOL 68 committee) Designed for teaching structured programming Small, simple, nothing really new Largest impac
40、t was on teaching programming From mid-1970s until the late 1990s, it was the most widely used language for teaching programming1-51C - 1972 Designed for systems programming (at Bell Labs by Dennis Richie) Evolved primarily from BCLP, B, but also ALGOL 68 Powerful set of operators, but poor type che
41、cking Initially spread through UNIX Many areas of application1-52Programming Based on Logic: Prolog Developed, by Comerauer and Roussel (University of Aix-Marseille), with help from Kowalski ( University of Edinburgh) Based on formal logic Non-procedural Can be summarized as being an intelligent dat
42、abase system that uses an inferencing process to infer the truth of given queries Highly inefficient, small application areas1-53Historys Largest Design Effort: Ada Huge design effort, involving hundreds of people, much money, and about eight years Strawman requirements (April 1975) Woodman requirem
43、ents (August 1975) Tinman requirements (1976) Ironman equipments (1977) Steelman requirements (1978) Named Ada after Augusta Ada Byron, the first programmer1-54Ada Evaluation Contributions Packages - support for data abstraction Exception handling - elaborate Generic program units Concurrency - thro
44、ugh the tasking model Comments Competitive design Included all that was then known about software engineering and language design First compilers were very difficult; the first really usable compiler came nearly five years after the language design was completed1-55Ada 95 Ada 95 (began in 1988) Supp
45、ort for OOP through type derivation(类型派生) Better control mechanisms for shared data New concurrency features More flexible libraries Popularity suffered because the DoD no longer requires its use but also because of popularity of C+1-56Object-Oriented Programming: Smalltalk Developed at Xerox PARC,
46、initially by Alan Kay, later by Adele Goldberg First full implementation of an object-oriented language (data abstraction, inheritance, and dynamic binding) Pioneered the graphical user interface design Promoted OOP1-57Combining Imperative and Object-Oriented Programming: C+ Developed at Bell Labs b
47、y Stroustrup in 1980 Evolved from C and SIMULA 67 Facilities for object-oriented programming, taken partially from SIMULA 67 Provides exception handling A large and complex language, in part because it supports both procedural and OO programming Rapidly grew in popularity, along with OOP ANSI standa
48、rd approved in November 2019 Microsofts version (released with .NET in 2019): Managed C+ delegates, interfaces, no multiple inheritance1-58Related OOP Languages Eiffel (designed by Bertrand Meyer - 1992) Not directly derived from any other language Smaller and simpler than C+, but still has most of
49、the power Lacked popularity of C+ because many C+ enthusiasts were already C programmers Delphi (Borland) Pascal plus features to support OOP More elegant and safer than C+1-59An Imperative-Based Object-Oriented Language: Java Developed at Sun in the early 1990s C and C+ were not satisfactory for em
50、bedded electronic devices Based on C+ Significantly simplified (does not include struct, union, enum, pointer arithmetic, and half of the assignment coercions of C+) Supports only OOP Has references, but not pointers Includes support for applets and a form of concurrency1-60Java Evaluation Eliminate
51、d many unsafe features of C+ Supports concurrency Libraries for applets, GUIs, database access Portable: Java Virtual Machine concept, JIT compilers Widely used for Web programming Use increased faster than any previous language1-61Scripting Languages for the WebPerlDesigned by Larry Wallfirst relea
52、sed in 1987Variables are statically typed but implicitly declaredThree distinctive namespaces, denoted by the first character of a variables namePowerful, but somewhat dangerousGained widespread use for CGI programming on the WebAlso used for a replacement for UNIX system administration languageJava
53、ScriptBegan at Netscape, but later became a joint venture of Netscape and Sun MicrosystemsA client-side HTML-embedded scripting language, often used to create dynamic HTML documentsPurely interpretedRelated to Java only through similar syntaxPHPPHP: Hypertext Preprocessor, designed by Rasmus LerdorfA server-side HTML-embedded scripting language, often used for form processing and database access thr
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 京东客服售前考核考试及答案
- 2026三农知识题库带答案(典型题)
- 2026年云南红河州银行业专业人员中级职业资格考试(专业实务个人理财)试题及答案
- 2026年银行笔试题库及答案
- 2026年起重信号司索工(建筑特殊工种)证考试题库及答案
- 2026年建筑行业安全员A证理论考试练习题及答案
- 2025年主治医师放射医学考试真题及答案
- 促销推广活动执行确认函(4篇)范文
- 人力资源服务企业人才招聘及培训计划
- 应急预案演练计划
- 娄底农商银行招聘考试题库
- 2026年文献检索和科技论文写作全真模拟模拟题附答案详解(研优卷)
- 2026年沃尔玛财务人员抗压能力面试题
- 哈密市巴里坤哈萨克自治县辅警(协警)招聘考试题库及答案
- 心墙坝课件教学课件
- 危化经营安全培训课件
- 企业导师带徒弟培训课件
- 企业资产管理制度模板通则
- 中石油购油协议书
- 手工编织手绳课件
- 农产品贮藏与营销课件
评论
0/150
提交评论