Levels of Abstraction What to expect from the course?

Problem Domain (stacks, tables) ‹ Superficially : Features in Java, C#, C++, Scheme, Scala Java, C#, Jython, Scala ‹ Broader Perspective : (Class Hierarchies) Paradigms : Imperative, Functional, Object-oriented Concepts : Ada » Abstract Data Types; Encapsulation C++ (ADTs) Pascal (int, ..., arrays) C » Features for Reuse – Class hierarchy; Polymorphism

Assembly Languages (X86,MIPS) » Features for Reliability Abstract (Java Bytecode, MSIL) – Strong typing Machine (char, int) – Exception mechanism » Recursion and List Processing.

cs480(Prasad) L0Intro 1 cs480(Prasad) L0Intro 2

Related Languages Example: Simple Language Design Issue

Java ‰ Reserving keywords contributes to simplicity. C++, C# IF IF = THEN THEN THEN=ELSE; Scala, Jython (Confusing but legal in PL/I) Modula-2, Modula-3, Oberon Control Abstraction Eiffel, Ada-95 ‰ if C then S1 else S2 vs Scheme if C goto 1; LISP, Common LISP S2; ML (* FORTRAN *) Haskell goto 2; 1: S1; 2: cs480(Prasad) L0Intro 3

1 1 Evolution of Programming Languages Evolution of Programming Languages

• FORTRAN ( FORmula TRANslator) Goals : Scientific Computations • ALGOL- 60 (ALGOrithmic Language) Efficiency of execution Goals : Communicating Compile-time storage determination Features : Structure (Top-down design) Features : Syypmbolic Expressions Recursion (Problem -solving strategy) Subprograms BNF - Specification Absence of Recursion (Peter Naur : 2005 ) ( : 1977 Turing Award) • LISP (LISt Processing) • COBOL Goals : Manipulating symbolic information Goal: Business Application Features : List Primitives Features : Data Definition and File Handling Interpreters / Environment (Grace Murray Hopper) (John McCarthy : 1971 Turing Award) cs480(Prasad) L0Intro 5 cs480(Prasad) L0Intro 6

C.A.R Hoare On Algol-60 Evolution of Programming Languages

‹ Here is a language so far ahead of its time, that it • PL / 1 was not only an improvement on its predecessors, FORTRAN + COBOL + SNOBOL+ but also on nearly all its successors. ... + concurrency + ... ‹ I conclude that there are two ways of constructing “ When FORTRAN has been called infantile a software design: One way is to make it so simple disorder, full PL /1, with its growth that there are obviously no deficiencies and the characteristics of a dangerous tumor, other way is to make it so complicated that there could turn out to be a fatal disease.” are no obvious deficiencies. ---- E. W. Dijkstra (C. A. R. Hoare : 1980 Turing Award) (1972 Turing Award Lecture)

cs480(Prasad) L0Intro 7 cs480(Prasad) L0Intro 8

2 2 Evolution of Programming Languages On C and C++

(SIMULAtion LAnguage) ‹ C makes it easy to shoot yourself in the foot, C++ makes it harder, but when you do, it blows away Features : Data Abstraction . your whole leg. -- Bjarne Stroustrup Class Hierarchies. (Inheritance) (O. J. Dahl, K. Nygaard : 2001 Turing Award) • C ‹ The last good thing written in C was Franz Goal : Systems Programming Schubert's Symphony number 9.

Features : Coding language for Unix. Portability. ‹ C is quirky, flawed, and an enormous success. (D. Richie and K. Thompson : 1983 Turing Award) -- Dennis M. Ritchie.

cs480(Prasad) L0Intro 9 cs480(Prasad) L0Intro 10

Evolution of Programming Languages On Type System; Efficiency

• Pascal Goal : Structured Programming, Compiler writing. ‹ Type security is intended not so much to Features : inspire programmers as to protect them • Rich set of data types for efficient from their own not inconsiderable frailties. design • E.g., Records, sets, ... ‹ MiiidihMore sins are committed in the • Variety of “readable” single-entry name of efficiency (without necessarily single-exit control structures • E.g., for-loop, while-loop,... achieving it) than for any other single • Efficient Implementation reason - including blind stupidity. • Recursive descent parsing -- William A. Wulf (N. Wirth : 1984 Turing Award) cs480(Prasad) L0Intro 11 cs480(Prasad) L0Intro 12

3 3 Other Languages Modern Scripting Languages ‹ Functional » Common LISP, Scheme ‹ Multiparadigm Constructs = » ML, Haskell ( : 1991 Turing Award (for ML)) OOP style + Functional style ‹ Logic (+ Ease of prototyping (Interpreter-based)) »Prolog ‹ Object-oriented » Smalltalk, Eiffel, Java, C# ‹ Examples: Python, Ruby, PERL, PHP, …, ( : 2003 Turing Award (for SmallTalk)) » C++, Ada-95, CLU JPython, JRuby, …,CAML, F# (: 2009 Turing Award (for CLU)) » Modula-3, Oberon Scala, … ‹ Application specific languages and tools cs480(Prasad) L0Intro 13 cs480(Prasad) L0Intro 14

On Comparing Languages

‹ I have reaffirmed a long-standing and strongly held view: Language comparisons are rarely meaningful and even less often fair. A good comparison of major programming languages requires more effort than most people are willing to spend, experience in a wide range of application areas, a rigid maintenance of a detached and impartial point of view, and a sense of fairness. ‹ Bjarne Stroustrup, The Design and Evolution of C++

cs480(Prasad) L0Intro 15

4 4