<<

Copyright () .A. van Engelen, FSU Department of Science, 2000-2002 Important Events in

1. Introduction History 1940s: The first electronic were monstrous Brief Summary of Course Objectives contraptions Programmed in binary by hand Improve the background for choosing appropriate programming Code is not reusable or relocatable languages Computation and machine maintainance were difficult: Be able in principle to program in a procedural, an cathode tubes regularly burned out object-oriented, a functional, and a logical programming The term bug originated from a bug that reportedly roamed language around in a machine causing short circuits Understand the significance of an implementation of a Assembly languages were invented to allow machine programming language in a compiler or operations to be expressed in mnemonic abbraviations Increase the ability to learn new programming languages Enables larger, reusable, and relocatable programs Increase the capacity to express general programming concepts Actual machine code is produced by assembler and to choose among alternative ways to express things in a Early assemblers had a one-to-one correspondance between particular programming language assembly and machine instructions Simulate useful features in languages that lack them Later: expansion into multiple machine instructions to Be able write programs that parse and translate (programming) achieve a form of higher-level programming languages

Be able in principle to design a new programming language

Note: These slides cover Chapter 1 Sections 1.1 to 1.3 of the textbook

Important Events in Programming Language Programming Language Genealogy History (cont') Mid 1950s: development of , the first arguably higher-level language Finally, programs could be developed that were machine independent! Main computing activity in the 50s: solve numerical problems in science and engineering Other high-level languages soon followed: Algol 58 is an improvement compared to Fortran Cobol for business computing Lisp for symbolic computing and artifical intelligence BASIC for "beginners" C for systems programming 1980s: Object-oriented programming Important innovation for software development The concept of a class is based on the notion of data type abstraction from 67 , a language for discrete event Note: go to the on-line textbook Appendix for a simulation that has classes but no inheritance list of programming languages and other links

Selected Overview of Programming Languages Selected Overview of Programming Languages

Fortran (I, II, IV, 77) Algol 60 Had a dramatic impact on computing in early days The original -structured language (local variables in a Is mainly used for numerical computation statement block) No recursion First use of Backus-Naur Form (BNF) to formally define Limited data types (no records and no pointers) language grammar Limited type checking All subsequent languages are based Very good compilers are available today on it Fortran (90, 95, HPF) No I/O and no character set, not widely used in US Major revisions, e.g. recursion , pointers, and records added Algol 68 New control constructs (eg. ) Large and relatively complex Extensive set of array operations Strong influence on Pascal , C , Ada HPF (High-Performance Fortran) includes constructs for Cobol parallel computation Originally developed by Department of Defense Lisp Intended for business data processing The original functional language developed by McCarthy Extensive numerical formatting features and decimal number as a realization of Church's storage Many dialects exist, including Common Lisp and Scheme Introduced the concept of records and nested selection Very powerful for symbolic computation with lists (e.g. for statements artificial intelligence) Basic Implicit memory management (allocate/deallocate) using Intended for interactive use (intepreted) and easy for garbage collection "beginners" Influenced languages (ML , Goals: easy to learn and use for non-science students Miranda, Haskell ) is a popular dialect

Selected Overview of Programming Languages Selected Overview of Programming Languages

PL/I -80 First exception handling Developed by XEROX PARC First pointer data type First full implementation of an object-oriented language Poorly designed, too large, too complex First design and use of window-based graphical user Pascal interfaces (GUIs) Designed for teaching "" APL Small and simple Intended for interactive use ("throw-away" programming) Simula 67 Highly expressive functional language makes programs Primarily designed for discrete-event simulation short, but hard to read Based on Algol 60 Many array operations Introduced concept of coroutines Introduced the class concept for data abstraction The most widely used language Ada Non-procedural (declarative: states what you want, not how Originally intended to be the standard language for all to get it) software commissioned by the Department of Defense Based on formal logic Very large Haskell Elaborate support for packages, exception handling , The leading purely functional language, based on Miranda generic program units, concurrency

Ada 95 Support for object-oriented programming New concurrency features

Selected Overview of Programming Languages So Why are There so Many Programming

C Languages? One of the most successful programming languages Evolution Primarely designed for systems programming but used more This course gives you some insight in what constitutes a widely good or a bad programming construct. (Appendix B of the Powerful set of operators, but weak type checking and no textbook has a long list of historical design mistakes) dynamic semantic checks Early 70s: structured programming in which goto-based C++ was replaced by high-level constructs such as The most successful of several object-oriented successors of while loops and case statements C Late 80s: nested block structure gave way to object-oriented Evolved from C and Simula 67 structures Large and complex, partly because it supports both Special Purposes procedural and object-oriented programming Many languages were designed for a specific problem Java domain. For example Developed by Sun Micorsystems Scientific applications Based on C++ , but significantly simplified Business applications Supports only object-oriented programming Artificial intelligence Safe language (e.g. no pointers but references, strongly Systems programming typed , and implicit garbage collection ) Personal Preference Portable and machine-independent The strength and variety of personal preference makes it Note: Follow this link to find more about Java. unlikely that anyone will ever develop a univerally acceptable programming language

What Makes a Programming Language Classification of Programming Languages Successful? Declarative : Implicit Functional (Lisp , Scheme , ML , Expressive Power solution Haskell ) All languages are equally powerful in technical sense (i.e. "What the computer should Logic (Prolog ) Turing complete) do" Dataflow Language features have a huge impact on the programmer's Imperative : Explicit Procedural "von Neumann" (Fortran ability to read, write, maintain, and analyze programs solution , C ) Abstraction facilities enhance expressive power "How the computer should Object-oriented (Smalltalk , C++ , Ease of Use for Novice do it" Java ) Low learning curve and often interpreted, eg. Basic and Logo Declarative functional example (Haskell) Ease of Implementation gcd a b Runs on virtually everything, e.g. Basic , Pascal , and Java | a == b = a | a > b = gcd (a-b) b Freely available, e.g. Java | a < b = gcd a (b-a) Excellent Compilers Fortran has extremely good compilers (because it lacks Declarative logic example (Prolog) recursion and pointers) and is therefore popular for gcd(A, A, A). gcd(A, B, G) :- A > B, N is A-B, gcd(N, B, G). numerical applications gcd(A, B, G) :- A < B, N is B-A, gcd(A, N, G). Supporting tools to help the programmer manage very large projects, e.g. Visual C++ Imperative procedural example (C) Economics, Patronage, and Inertia int gcd(int a, int b) Powerful sponsor: Cobol , PL/I , Ada { while (a != b) Some languages remain widely used long after "better" if (a > b) a = a-b; else b = b-a; alternatives because of a huge base of installed software and return a; } programmer experience

Classification of Programming Languages (cont'd)