Copyright (C) R.A. van Engelen, FSU Department of Computer Science, 2000-2002

 
1. Introduction

Brief Summary of Course Objectives

  • Improve the background for choosing appropriate programming languages
  • Be able in principle to program in a procedural, an object-oriented, a functional, and a logical programming language
  • Understand the significance of an implementation of a programming language in a compiler or interpreter
  • Increase the ability to learn new programming languages
  • Increase the capacity to express general programming concepts and to choose among alternative ways to express things in a particular programming language
  • Simulate useful features in languages that lack them
  • Be able write programs that parse and translate (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 History

  • 1940s: The first electronic computers were monstrous contraptions
    • Programmed in binary machine codeDefine this term by hand
    • Code is not reusable or relocatableDefine this term
    • Computation and machine maintainance were difficult: cathode tubes regularly burned out
    • The term bug originated from a bug that reportedly roamed around in a machine causing short circuits
  • Assembly languagesDefine this term were invented to allow machine operations to be expressed in mnemonic abbraviations
    • Enables larger, reusable, and relocatableDefine this term programs
    • Actual machine code is produced by assemblerDefine this term
    • Early assemblers had a one-to-one correspondance between assembly and machine instructions
    • Later: macro expansion into multiple machine instructions to achieve a form of higher-level programming

 

Important Events in Programming Language History (cont'd)

  • Mid 1950s: development of FortranDefine this term, 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
      • CobolDefine this term for business computing
      • LispDefine this term for symbolic computing and artifical intelligence
      • BASICDefine this term for "beginners"
      • CDefine this term for systems programming
  • 1980s: Object-oriented programmingDefine this term
    • Important innovation for software development
    • The concept of a classDefine this term is based on the notion of data type abstractionDefine this term from Simula 67Define this term, a language for discrete event simulation that has classesDefine this term but no inheritanceDefine this term

 

Programming Language Genealogy

Note: go to the on-line textbook Appendix for a list of programming languages and other links

 

Selected Overview of Programming Languages

  • FortranDefine this term (I, II, IV, 77)
    • Had a dramatic impact on computing in early days
    • Is mainly used for numerical computation
    • No recursion
    • Limited data types (no records and no pointers)
    • Limited type checking
    • Very good compilers are available today
  • FortranDefine this term (90, 95, HPF)
    • Major revisions, e.g. recursionDefine this term, pointers, and records added
    • New control constructs (eg. while loop)
    • Extensive set of array operations
    • HPF (High-Performance Fortran) includes constructs for parallel computation
  • LispDefine this term
    • The original functionalDefine this term language developed by McCarthy as a realization of Church's lambda calculusDefine this term
    • Many dialects exist, including Common Lisp and SchemeDefine this term
    • Very powerful for symbolic computation with lists (e.g. for artificial intelligence)
    • Implicit memory management (allocate/deallocate) using garbage collectionDefine this term
    • Influenced functional programming languages (MLDefine this term, Miranda, HaskellDefine this term)

 

Selected Overview of Programming Languages

  • Algol 60Define this term
    • The original block-structuredDefine this term language (local variables in a statement block)
    • First use of Backus-Naur Form (BNF)Define this term to formally define language grammar
    • All subsequent imperative programming languages are based on it
    • No I/O and no character set, not widely used in US
  • Algol 68Define this term
    • Large and relatively complex
    • Strong influence on PascalDefine this term, CDefine this term, AdaDefine this term
  • CobolDefine this term
    • Originally developed by Department of Defense
    • Intended for business data processing
    • Extensive numerical formatting features and decimal number storage
    • Introduced the concept of records and nested selection statements
  • BasicDefine this term
    • Intended for interactive use (intepreted) and easy for "beginners"
    • Goals: easy to learn and use for non-science students
    • Visual Basic is a popular dialect

 

Selected Overview of Programming Languages

  • PL/IDefine this term
    • First exception handlingDefine this term
    • First pointer data type
    • Poorly designed, too large, too complex
  • PascalDefine this term
    • Designed for teaching "structured programming"Define this term
    • Small and simple
  • Simula 67Define this term
    • Primarily designed for discrete-event simulation
    • Based on Algol 60
    • Introduced concept of coroutinesDefine this term
    • Introduced the classDefine this term concept for data abstraction
  • AdaDefine this term
    • Originally intended to be the standard language for all software commissioned by the Department of Defense
    • Very large
    • Elaborate support for packages, exception handlingDefine this term, generic program units, concurrency
  • Ada 95Define this term
    • Support for object-oriented programmingDefine this term
    • New concurrency features

 

Selected Overview of Programming Languages

  • Smalltalk-80Define this term
    • Developed by XEROX PARC
    • First full implementation of an object-orientedDefine this term language
    • First design and use of window-based graphical user interfaces (GUIs)
  • APLDefine this term
    • Intended for interactive use ("throw-away" programming)
    • Highly expressive functionalDefine this term language makes programs short, but hard to read
    • Many array operations
  • PrologDefine this term
    • The most widely used logicDefine this term programming language
    • Non-procedural (declarative: states what you want, not how to get it)
    • Based on formal logic
  • HaskellDefine this term
    • The leading purely functionalDefine this term language, based on MirandaDefine this term

 

Selected Overview of Programming Languages

  • CDefine this term
    • One of the most successful programming languages
    • Primarely designed for systems programming but used more widely
    • Powerful set of operators, but weak type checking and no dynamic semantic checksDefine this term
  • C++Define this term
    • The most successful of several object-oriented successors of C
    • Evolved from CDefine this term and Simula 67Define this term
    • Large and complex, partly because it supports both proceduralDefine this term and object-orientedDefine this term programming
  • JavaDefine this term
    • Developed by Sun Micorsystems
    • Based on C++Define this term, but significantly simplified
    • Supports only object-oriented programmingDefine this term
    • Safe languageDefine this term (e.g. no pointers but references, strongly typedDefine this term, and implicit garbage collectionDefine this term)
    • Portable and machine-independent
Note: Follow this link to find more about Java.

 

So Why are There so Many Programming Languages?

  • Evolution
    • This course gives you some insight in what constitutes a good or a bad programming construct. (Appendix B of the textbook has a long list of historical design mistakes)
    • Early 70s: structured programmingDefine this term in which goto-based control flow was replaced by high-level constructs such as while loops and case statements
    • Late 80s: nested block structure gave way to object-orientedDefine this term structures
  • Special Purposes
    • Many languages were designed for a specific problem domain. For example
      • Scientific applications
      • Business applications
      • Artificial intelligence
      • Systems programming
  • Personal Preference
    • The strength and variety of personal preference makes it unlikely that anyone will ever develop a univerally acceptable programming language

 

What Makes a Programming Language Successful?

  • Expressive Power
    • All languages are equally powerful in technical sense (i.e. Turing complete)
    • Language features have a huge impact on the programmer's ability to read, write, maintain, and analyze programs
    • Abstraction facilities enhance expressive power
  • Ease of Use for Novice
    • Low learning curve and often interpreted, eg. BasicDefine this term and LogoDefine this term
  • Ease of Implementation
    • Runs on virtually everything, e.g. BasicDefine this term, PascalDefine this term, and JavaDefine this term
    • Freely available, e.g. JavaDefine this term
  • Excellent Compilers
    • Fortran has extremely good compilers (because it lacks recursion and pointers) and is therefore popular for numerical applications
    • Supporting tools to help the programmer manage very large projects, e.g. Visual C++
  • Economics, Patronage, and Inertia
    • Powerful sponsor: CobolDefine this term, PL/IDefine this term, AdaDefine this term
    • Some languages remain widely used long after "better" alternatives because of a huge base of installed software and programmer experience

 

Classification of Programming Languages

DeclarativeDefine this term: Implicit solution
"What the computer should do"
FunctionalDefine this term (LispDefine this term, SchemeDefine this term, MLDefine this term, HaskellDefine this term)
LogicDefine this term (PrologDefine this term)
DataflowDefine this term
ImperativeDefine this term: Explicit solution
"How the computer should do it"
ProceduralDefine this term "von Neumann" (FortranDefine this term, CDefine this term)
Object-orientedDefine this term (SmalltalkDefine this term, C++Define this term, JavaDefine this term)
  • Declarative functional example (Haskell)
  • gcd a b
      | a == b = a
      | a >  b = gcd (a-b) b
      | a <  b = gcd a (b-a)
  • Declarative logic example (Prolog)
  • gcd(A, A, A).
    gcd(A, B, G) :- A > B, N is A-B, gcd(N, B, G).
    gcd(A, B, G) :- A < B, N is B-A, gcd(A, N, G).
  • Imperative procedural example (C)
  • int gcd(int a, int b)
    { while (a != b)
        if (a > b) a = a-b; else b = b-a;
      return a;
    }

 

Classification of Programming Languages (cont'd)