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

 
1. Introduction

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

 

Course Outline

  1. Introduction: History of programming languages, classification of languages, and overview of languages
  2. Functional Programming: Scheme
  3. Compilers and Interpreters: How programs are translated to machine code and executed
  4. Syntax: How syntax is defined and how syntax can impact the use of languages
  5. Semantics: How the meaning and behavior of programming constructs are defined
  6. Names, Scopes, and Bindings: How and when bindings for local names are defined in languages with scoping rules
  7. Control Flow: How programming constructs define control flow and how these constructs can affect programming style
  8. Subroutines and Parameter Passing: How the subrouting calling mechanism is implemented and how and when parameters are passed
  9. Exception Handling: How to improve the stability and robustness of your programs
  10. Logic Programming: Prolog
Note: This Introduction starts with Chapter 1 of the textbook. Read Chapter 1 Sections 1.1 to 1.3. Study the on-line programming examples and explanations by following the ``[read more]'' links given in the slides below.

 

Important Events in Programming Language History

  • Programming languagesDefine this term are central to Computer Science
  • 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 [read more]
    • Enables larger, reusable, and relocatable programs
    • Actual machine code is produced by an assemblerDefine this term
    • Early assemblers had a one-to-one correspondance between assembly and machine instructions
    • Later: expansion of macrosDefine this term 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


 

Selected Overview of Programming Languages

  • Fortran (I, II, IV, 77) [read more]
    • 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
  • Fortran (90, 95, HPF) [read more]
    • 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
  • Lisp (Common Lisp and Scheme) [read more]
    • 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 Scheme
    • 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 60 [read more]
    • 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
    • Based on Algol 60 but large and relatively complex
    • Strong influence on PascalDefine this term, CDefine this term, AdaDefine this term
  • Cobol [read more]
    • Originally developed by the 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
  • Basic [read more]
    • Intended for interactive use (intepreted) and easy for "beginners"
    • Goals: easy to learn and use for non-science students
    • Structure of early basic dialects were similar to Fortran
    • Visual Basic is a popular dialect

 

Selected Overview of Programming Languages

  • PL/I [read more]
    • Introduced exception handlingDefine this term
    • First language with pointer data type
    • Poorly designed, too large, too complex
  • Pascal [read more]
    • Designed for teaching "structured programming"Define this term
    • Small and simple
  • Simula 67Define this term
    • Based on Algol 60
    • Primarily designed for discrete-event simulation
    • Introduced concept of coroutinesDefine this term
    • Introduced the classDefine this term concept for data abstraction
  • Ada (Ada 83) [read more]
    • 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-80 [read more]
    • 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
  • Prolog [read more]
    • 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
  • Haskell [read more]
    • The leading purely functionalDefine this term language, based on MirandaDefine this term

 

Selected Overview of Programming Languages

  • C [read more]
    • 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++ [read more]
    • 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
  • Java [read more]
    • Developed by Sun Microsystems
    • 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 with Java virtual machine (JVM)
  • C#Define this term
    • Similar to Java and C++, but platform dependent (MS .NET)
    • Common Lanuage Runtime (CLR) manages objects that can be shared among the different languages in .NET

 

So Why are There so Many Programming Languages?

  • Evolution
    • What constitutes a good or a bad programming construct? See Appendix B of the textbook for a list of design considerations
    • 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
      • Internet programming
  • Personal Preference
    • The strength and variety of personal preference makes it unlikely that anyone will ever develop a univerally accepted 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)

Note: Looking for more information on programming languages? Then read the on-line textbook Appendix with a list of programming languages and links to resources related to programming languages.
Exercise 1: Write down the different ways in which program loops are written in MIPS assembly, Fortran 77, Fortran 90, Algol 60, Quick Basic, PL/I, Pascal, Ada 83, C, and Java.
Exercise 2: Find the persons who were instrumental to the development of Lisp, Pascal, and Simula 67.
Exercise 3: Which organization(s) developed PL/I and why is PL/I not considered a successful programming language?
Exercise 4: Which organization(s) developed Ada?
Exercise 5: Search the Web for an answer to: "What is the most frequently used programming language?" In what area(s) is this language used?
Exercise 6: Search the Web for an answer to: "What is the most popular programming language?" How did you make sure that you can trust the search result?
Exercise 7: Which language(s) is/are good for manipulating symbolic data and complex data structures according to the textbook?