《主要程序设计语言的发展.ppt》由会员分享,可在线阅读,更多相关《主要程序设计语言的发展.ppt(66页珍藏版)》请在三一办公上搜索。
1、,Chapter 2,Evolution of the Major Programming Languages主要程序设计语言的发展,孟小亮 QQ:1920525866,1-2,Chapter 2 Topics,Zuses PlankalklMinimal Hardware Programming:PseudocodesThe IBM 704 and FortranFunctional Programming:LISPThe First Step Toward Sophistication:ALGOL 60Computerizing Business Records:COBOLThe Begi
2、nnings of Timesharing:BASIC,1-3,Chapter 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 on Logic:PrologHistorys Largest Design Effort
3、:Ada,1-4,Chapter 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/Programming Hybrid Languages,1-5,Genealogy of Common Lan
4、guages,1-6,Zuses Plankalkl,Designed in 1945,but not published until 1972Never implementedAdvanced data structuresfloating point,arrays,recordsInvariants,1-7,Plankalkl Syntax,An assignment statement to assign the expression A4+1 to A5|A+1=A V|4 5(subscripts)S|1.n 1.n(data types),1-8,Minimal Hardware
5、Programming:Pseudocodes,What was wrong with using machine code?Poor readabilityPoor modifiabilityExpression coding was tediousMachine deficiencies-no indexing or floating point,1-9,Pseudocodes:Short Code,Short Code developed by Mauchly in 1949 for BINAC computers Expressions were coded,left to right
6、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 tab,1-10,Pseudocodes:Speedcoding,Speedcoding developed by Backus in 1954 for IBM 701Pseudo ops for arithmetic and math functionsConditional and unconditional branchingAuto-increment regist
7、ers for array accessSlow!Only 700 words left for user program,1-11,Pseudocodes:Related Systems,The UNIVAC Compiling SystemDeveloped by a team led by Grace HopperPseudocode expanded into machine codeDavid J.Wheeler(Cambridge University)developed a method of using blocks of re-locatable addresses to s
8、olve the problem of absolute addressing,1-12,IBM 704 and Fortran,Fortran 0:1954-not implementedFortran I:1957Designed for the new IBM 704,which had index registers and floating point hardware-This led to the idea of compiled programming languages,because there was no place to hide the cost of interp
9、retation(no floating-point software)Environment of developmentComputers were small and unreliableApplications were scientificNo programming methodology or toolsMachine efficiency was the most important concern,1-13,Design Process of Fortran,Impact of environment on design of Fortran INo need for dyn
10、amic storageNeed good array handling and counting loopsNo string handling,decimal arithmetic,or powerful input/output(for business software),1-14,Fortran I Overview,First implemented version of FortranNames could have up to six charactersPost-test counting loop(DO)Formatted I/OUser-defined subprogra
11、msThree-way selection statement(arithmetic IF)No data typing statements,1-15,Fortran I Overview(continued),First implemented version of FORTRAN No separate compilationCompiler released in April 1957,after 18 worker-years of effortPrograms larger than 400 lines rarely compiled correctly,mainly due to
12、 poor reliability of 704Code was very fastQuickly became widely used,1-16,Fortran II,Distributed in 1958Independent compilation(主要指子程序的单独编译)Fixed the bugs,1-17,Fortran IV,Evolved during 1960-62Explicit type declarationsLogical selection statementSubprogram names could be parametersANSI standard in 1
13、966(美国国家标准学会),1-18,Fortran 77,Became the new standard in 1978Character string handlingLogical loop control statementIF-THEN-ELSE statement,1-19,Fortran 90,Most significant changes from Fortran 77ModulesDynamic arraysPointersRecursionCASE statementParameter type checking,1-20,Latest versions of Fortr
14、an,Fortran 95 relatively minor additions,plus some deletionsFortran 2003 dittoFortran 2008-ditto,1-21,Fortran Evaluation,Highly optimizing compilers(all versions before 90)Types and storage of all variables are fixed before run timeDramatically changed forever the way computers are usedCharacterized
15、 as the lingua franca(通用语言)of the computing world,1-22,Functional Programming:LISP,LISt Processing language Designed at MIT by McCarthyAI research needed a language toProcess data in lists(rather than arrays)Symbolic computation(rather than numeric)Only two data types:atoms and listsSyntax is based
16、on lambda calculus(微积分,最早的举例就是微分代数表达式),1-23,Representation of Two LISP Lists,Representing the lists(A B C D)and(A(B C)D(E(F G),1-24,LISP Evaluation,Pioneered functional programmingNo need for variables or assignmentControl via recursion and conditional expressionsStill the dominant language for AICO
17、MMON LISP and Scheme are contemporary dialects of LISPMetaLanguage,Miranda,and Haskell are related languages,1-25,Scheme,Developed at MIT in mid 1970sSmallExtensive use of static scopingFunctions as first-class entitiesSimple syntax(and small size)make it ideal for educational applications,1-26,COMM
18、ON LISP,An effort to combine features of several dialects of LISP into a single languageLarge,complex,1-27,The First Step Toward Sophistication:ALGOL 60(迈向成熟的第一步),Environment of developmentFORTRAN had(barely)arrived for IBM 70 xMany other languages were being developed,all for specific machinesNo po
19、rtable language;all were machine-dependentNo universal language for communicating algorithmsALGOL 60 was the result of efforts to design a universal language,1-28,Early Design Process,ACM(计算机协会)and GAMM(应用数学和力学社团)met for four days for design(May 27 to June 1,1958)Goals of the languageClose to mathem
20、atical notationGood for describing algorithmsMust be translatable to machine code,1-29,ALGOL 58,Concept of type was formalizedNames could be any lengthArrays could have any number of subscriptsParameters were separated by mode(in&out)Subscripts were placed in bracketsCompound statements(begin.end)Se
21、micolon as a statement separatorAssignment operator was:=if had an else-if clauseNo I/O-“would make it machine dependent”,1-30,ALGOL 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 1959,1-31,ALG
22、OL 60 Overview,Modified ALGOL 58 at 6-day meeting in ParisNew featuresBlock structure(local scope)Two parameter passing methodsSubprogram recursionStack-dynamic arraysStill no I/O and no string handling,1-32,ALGOL 60 Evaluation,SuccessesIt was the standard way to publish algorithms for over 20 years
23、All subsequent imperative languages are based on itFirst machine-independent languageFirst language whose syntax was formally defined(BNF),1-33,ALGOL 60 Evaluation(continued),FailureNever widely used,especially in U.S.ReasonsLack of I/O and the character set made programs non-portableToo flexible-ha
24、rd to implementEntrenchment of FortranFormal syntax descriptionLack of support from IBM,1-34,Computerizing Business Records:COBOL,Environment of developmentUNIVAC was beginning to use FLOW-MATICUSAF was beginning to use AIMACOIBM was developing COMTRAN,1-35,COBOL Historical Background,Based on FLOW-
25、MATICFLOW-MATIC featuresNames up to 12 characters,with embedded hyphensEnglish names for arithmetic operators(no arithmetic expressions)Data and code were completely separateThe first word in every statement was a verb,1-36,COBOL Design Process,First Design Meeting(Pentagon)-May 1959Design goalsMust
26、 look like simple EnglishMust be easy to use,even if that means it will be less powerfulMust broaden the base of computer usersMust not be biased by current compiler problemsDesign committee members were all from computer manufacturers and DoD branchesDesign Problems:arithmetic expressions?subscript
27、s?Fights among manufacturers,1-37,COBOL Evaluation,ContributionsFirst macro facility in a high-level languageHierarchical data structures(records)Nested selection statementsLong names(up to 30 characters),with hyphensSeparate data division,1-38,COBOL:DoD Influence,First language required by DoDwould
28、 have failed without DoDStill the most widely used business applications language,1-39,The Beginning of Timesharing:BASIC,Designed by Kemeny&Kurtz at DartmouthDesign Goals:Easy to learn and use for non-science studentsMust be“pleasant and friendly”Fast turnaround for homeworkFree and private accessU
29、ser time is more important than computer timeCurrent popular dialect:Visual BASIC First widely used language with time sharing(分时性,多人使用同一台计算机),1-40,2.8 Everything for Everybody:PL/I,Designed by IBM and SHAREComputing situation in 1964(IBMs point of view)Scientific computingIBM 1620 and 7090 computer
30、sFORTRANSHARE user groupBusiness computingIBM 1401,7080 computersCOBOLGUIDE user group,1-41,PL/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
31、of computers,languages,and support staff-too costlyThe obvious solutionBuild a new computer to do both kinds of applicationsDesign a new language to do both kinds of applications,1-42,PL/I:Design Process,Designed in five months by the 3 X 3 CommitteeThree members from IBM,three members from SHAREIni
32、tial conceptAn extension of Fortran IVInitially called NPL(New Programming Language)Name changed to PL/I in 1965,1-43,PL/I:Evaluation,PL/I contributionsFirst unit-level concurrencyFirst exception handlingSwitch-selectable recursionFirst pointer data typeFirst array cross sectionsConcernsMany new fea
33、tures were poorly designedToo large and too complex,1-44,Two Early Dynamic Languages:APL and SNOBOL,Characterized by dynamic typing and dynamic storage allocationVariables are untypedA variable acquires a type when it is assigned a valueStorage is allocated to a variable when it is assigned a value,
34、1-45,APL:A Programming Language,Designed as a hardware description language at IBM by Ken Iverson around 1960Highly expressive(many operators,for both scalars and arrays of various dimensions)Programs are very difficult to readStill in use;minimal changes,1-46,SNOBOL(String Orientated Symbolic Langu
35、age),Designed as a string manipulation language at Bell Labs by Farber,Griswold,and Polensky in 1964Powerful operators for string pattern matchingSlower than alternative languages(and thus no longer used for writing editors)Still used for certain text processing tasks,1-47,The Beginning of Data Abst
36、raction:SIMULA 67,Designed primarily for system simulation in Norway by Nygaard and DahlBased on ALGOL 60 and SIMULA IPrimary ContributionsCoroutines-a kind of subprogramClasses,objects,and inheritance,1-48,Orthogonal Design:ALGOL 68,From the continued development of ALGOL 60 but not a superset of t
37、hat languageSource of several new ideas(even though the language itself never achieved widespread use)Design is based on the concept of orthogonalityA few basic concepts,plus a few combining mechanisms,1-49,ALGOL 68 Evaluation,ContributionsUser-defined data structuresReference typesDynamic arrays(ca
38、lled flex arrays)CommentsLess usage than ALGOL 60Had strong influence on subsequent languages,especially Pascal,C,and Ada,1-50,Pascal-1971,Developed by Wirth(a former member of the ALGOL 68 committee)Designed for teaching structured programmingSmall,simple,nothing really newLargest impact was on tea
39、ching programmingFrom mid-1970s until the late 1990s,it was the most widely used language for teaching programming,1-51,C-1972,Designed for systems programming(at Bell Labs by Dennis Richie)Evolved primarily from BCLP,B,but also ALGOL 68Powerful set of operators,but poor type checkingInitially sprea
40、d through UNIXMany areas of application,1-52,Programming Based on Logic:Prolog,Developed,by Comerauer and Roussel(University of Aix-Marseille),with help from Kowalski(University of Edinburgh)Based on formal logicNon-proceduralCan be summarized as being an intelligent database system that uses an inf
41、erencing process to infer the truth of given queriesHighly inefficient,small application areas,1-53,Historys Largest Design Effort:Ada,Huge design effort,involving hundreds of people,much money,and about eight yearsStrawman requirements(April 1975)Woodman requirements(August 1975)Tinman requirements
42、(1976)Ironman equipments(1977)Steelman requirements(1978)Named Ada after Augusta Ada Byron,the first programmer,1-54,Ada Evaluation,ContributionsPackages-support for data abstractionException handling-elaborate Generic program unitsConcurrency-through the tasking modelCommentsCompetitive designInclu
43、ded all that was then known about software engineering and language designFirst compilers were very difficult;the first really usable compiler came nearly five years after the language design was completed,1-55,Ada 95,Ada 95(began in 1988)Support for OOP through type derivation(类型派生)Better control m
44、echanisms for shared dataNew concurrency featuresMore flexible librariesPopularity suffered because the DoD no longer requires its use but also because of popularity of C+,1-56,Object-Oriented Programming:Smalltalk,Developed at Xerox PARC,initially by Alan Kay,later by Adele GoldbergFirst full imple
45、mentation of an object-oriented language(data abstraction,inheritance,and dynamic binding)Pioneered the graphical user interface designPromoted OOP,1-57,Combining Imperative and Object-Oriented Programming:C+,Developed at Bell Labs by Stroustrup in 1980Evolved from C and SIMULA 67 Facilities for obj
46、ect-oriented programming,taken partially from SIMULA 67Provides exception handlingA large and complex language,in part because it supports both procedural and OO programmingRapidly grew in popularity,along with OOPANSI standard approved in November 1997Microsofts version(released with.NET in 2002):M
47、anaged C+delegates,interfaces,no multiple inheritance,1-58,Related OOP Languages,Eiffel(designed by Bertrand Meyer-1992)Not directly derived from any other languageSmaller and simpler than C+,but still has most of the powerLacked popularity of C+because many C+enthusiasts were already C programmersD
48、elphi(Borland)Pascal plus features to support OOPMore elegant and safer than C+,1-59,An Imperative-Based Object-Oriented Language:Java,Developed at Sun in the early 1990sC and C+were not satisfactory for embedded electronic devicesBased on C+Significantly simplified(does not include struct,union,enu
49、m,pointer arithmetic,and half of the assignment coercions of C+)Supports only OOPHas references,but not pointersIncludes support for applets and a form of concurrency,1-60,Java Evaluation,Eliminated many unsafe features of C+Supports concurrencyLibraries for applets,GUIs,database accessPortable:Java
50、 Virtual Machine concept,JIT compilersWidely used for Web programmingUse increased faster than any previous language,1-61,Scripting Languages for the Web,PerlDesigned by Larry Wallfirst released in 1987Variables are statically typed but implicitly declaredThree distinctive namespaces,denoted by the