Chapter 2Genealogy of Common LanguagesMinimal Hardware Programming: PseudocodesMachine Language to Pseudocodes (Assembly Language)IBM 704 and FortranFortran I OverviewFortran I, II, IVFortran 90 and thereafterFortran EvaluationFunctional Programming: LISPRepresentation of Two LISP ListsLISP EvaluationCommon LispThe First Step Toward Sophistication: ALGOL 60ALGOL 58 (Not Implemented)ALGOL 60 OverviewALGOL 60 EvaluationCOBOL Design ProcessCOBOL EvaluationBeginning of Timesharing: BASICPL/1 - Everything for EverybodyPL/I: BackgroundPL/I: Design ProcessTwo Early Dynamic Languages: APL and SNOBOLAPL: A Programming LanguageSNOBOLThe Beginning of Data Abstraction: SIMULA 67Orthogonal Design: ALGOL 68Pascal - 1971C - 1972Programming Based on Logic: PrologAda EvaluationAda 95Object-Oriented Programming: SmalltalkCombining Imperative and Object-Oriented Programming: C++Related OOP LanguagesAn Imperative-Based Object-Oriented Language: JavaJava EvaluationScripting Languages for the WebSlide 40Slide 41Slide 42Slide 43The Flagship .NET Language: C#Markup/Programming Hybrid LanguagesWeb Server-Side Programming http://w3techs.com/technologies/overview/programming_language/allChapter 2Evolution of the Major Programming LanguagesCopyright © 2012 Addison-Wesley. All rights reserved. 1-2Genealogy of Common LanguagesCopyright © 2012 Addison-Wesley. All rights reserved. 1-3Minimal Hardware Programming: Pseudocodes•What was wrong with using machine code?–Poor readability–Poor modifiability–Expression coding was tedious–Machine deficiencies--no indexing or floating pointCopyright © 2012 Addison-Wesley. All rights reserved. 1-4Machine Language to Pseudocodes (Assembly Language)•Speedcoding by Backus in 1954 for IBM 701–Pseudo ops for arithmetic and math functions–Conditional and unconditional branching–Auto-increment registers for array access–Slow!–Only 700 words left for user program•The UNIVAC Compiling System–Developed by a team led by Grace Hopper–Pseudocode expanded into machine code•David J. Wheeler (Cambridge University) –developed a method of using blocks of re-locatable addresses to solve the problem of absolute addressingCopyright © 2012 Addison-Wesley. All rights reserved. 1-5IBM 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 to the idea of compiled programming languages–Environment of development•Computers were small and unreliable•Applications were scientific•No programming methodology or tools•Machine efficiency was the most important concernCopyright © 2012 Addison-Wesley. All rights reserved. 1-6Fortran I Overview•First implemented version of 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 statements, –No separate compilation–Compiler released in April 1957 (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 usedCopyright © 2012 Addison-Wesley. All rights reserved. 1-7Fortran I, II, IV•Fortran I–Distributed in 1958, Independent compilation, Fixed the bugs•Fortran IV–Evolved during 1960-62, –Explicit type declarations, Logical selection statement, –Subprogram names could be parameters, –ANSI standard in 1966•Fortran 77–Became the new standard in 1978–Character string handling–Logical loop control statement–IF-THEN-ELSE statementCopyright © 2012 Addison-Wesley. All rights reserved. 1-8Fortran 90 and thereafter•Fortran 90–Most significant changes from Fortran 77•Modules, Dynamic arrays, Pointers, Recursion•CASE statement, Parameter type checking•Fortran 95 – relatively minor changes•Fortran 2003 – support for OOP, procedure pointers, interoperability with C•Fortran 2008 – blocks for local scopes, co-arrays, Do ConcurrentCopyright © 2012 Addison-Wesley. All rights reserved. 1-9Fortran Evaluation•Highly optimizing compilers (all versions before 90)–Types and storage of all variables are fixed before run time•Dramatically changed forever the way computers are used, in Scientific and/or Engineering Programming•Still in UseCopyright © 2012 Addison-Wesley. All rights reserved. 1-10Functional Programming: LISP•LISt Processing language– Designed at MIT by McCarthy 1958•AI research needed a language 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 calculusCopyright © 2012 Addison-Wesley. All rights reserved. 1-11Representation of Two LISP ListsRepresenting the lists (A B C D)and (A (B C) D (E (F G)))Copyright © 2012 Addison-Wesley. All rights reserved. 1-12LISP Evaluation•Pioneered 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•ML, Haskell, and F# are also functional programming languages, but use very different syntaxCopyright © 2012 Addison-Wesley. All rights reserved. 1-13Common Lisp–An effort to combine features of several dialects of LISP into a single language–Large, complex, used in industry for some large applicationsScheme–Developed at MIT in mid 1970s–Small–Extensive use of static scoping–Functions as first-class entities–Simple syntax (and small size) make it ideal for educational applicationsCopyright © 2012 Addison-Wesley. All rights reserved. 1-14The First Step Toward Sophistication: ALGOL 60•Environment of development–FORTRAN had (barely) arrived for IBM 70x–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 to design a universal language•Goals: (1) Close to mathematical notation, (2) Good for describing algorithms, (3) Must be translatable to machine codeCopyright © 2012 Addison-Wesley. All rights reserved. 1-15ALGOL 58 (Not Implemented)•Concept of type was formalized•Names could 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 ...
View Full Document