Introduction
- Different Generation of Languages
- No agreement among the authors about the proper demarkation
- Machine language, Assembly language (symbols instead of numerci
code), Third generation (FORTRAN, C, Pascal), 4GL (Application
specific such as Powerhouse), Fifth generation languages (Prolog)
- Machine language - every detail is specified
- Prolog - Very few details are specified
- Why high level languages?
- pages 7-8
- readibility
- portability
- library support
- limited syntax checking
- UNIX was written in C
- Section 1.2 describes some of the problems associated with
writing correct programs
- Any debugging effort is essentially limited by the human imagination
- If you organize your programs properly, it is easier to spot
the errors
- Paradigms
- Imperative
- Functional
- Object oriented
- Logical
- Generally, if you know one language from a paradigm, it is
possible to learn another language from the same paradigm fairly
easily.
- Imperative
- FORTRAN system (was not proposed as a language). Demonstrated
that translated code can be bettern than most machine language
programmers.
- Fortran did not provide facilities for structured programming
- Algol 60 was an effort to rectify many of the shortcomings
- Pascal: Developed for education use
- C: Developed as an implementation language
- Functional programming
- Lisp (List Processing)
- Was and still is a popular language for AI programming
- Symbolic manipulations
- ISWIM (tried to remove Lot of Inconvenient Stupid Parantheses)
- Fig. 1.4 shows other descendants of Lisp
- Just as the imperative programmers have C++, Function programming
also have object orinted flavor in languages such as CLOS
- Object oriented languages
- Simula
- Used for simulation
- C++ comes from the imperative side
- Smalltalk more of a system than a language
- Logic Programming
- Prolog
- Uses limited subset of logic called Horn Clause logic
- Specify the logical rules
- Ask questions - the system will use the logic to answer the
question
- Translators
- Compiler
- Translates a high level program and creates a machine laguage
copy of the program
- Essentially bringing the program down to the machine level
- Faster than machine code written by average machine language
programmer but slower than the machine code written by good machine
language programmer
- Faster than interpreted programs
- Interpreter
- Does not translate the entire program in its entirety into
the machine language
- Translation is done one instruction at a time
- Every time the program is run the translation has to take
place
- Interpreter can be looked at as a virtual machine that understands
and executes higher level instruction
- Advantages: dynamic programs, can do some run time tricks
that are not easily possible in compiled programs