Programming Languages Study Notes

What is a Programming Language?

  • A programming language is a set of rules that tells a computer what operations to perform.
  • It provides a linguistic framework for describing computations.
  • It is a notational system for describing computation in a machine-readable and human-readable form.
  • It is a tool for developing executable models for a class of problem domains.

Programming Language Components

  • English is a natural language; programming languages are designed languages with their own rules.
  • They have words, symbols, and grammatical rules.
  • Grammatical rules are called syntax.
  • Each programming language has its own syntax rules.

Generations of Programming Languages

  • Generations represent phased improvements in usability, ease of use, and power.

  • There are five generations of programming languages: 1GL,2GL,3GL,4GL,5GL1GL, 2GL, 3GL, 4GL, 5GL

  • The evolution aims to reduce programmer effort while increasing reliability and robustness.

  • 1st Generation Languages (1GL): Machine Language

    • Also called low-level language; programmed at the machine level.
    • Programs are a sequence of binary numbers.
    • Advantages:
    • Translation-free and directly executable by the computer.
    • Programs execute very quickly and efficiently on the CPU.
    • Memory usage can be optimized because data bits can be tracked precisely.
  • 2nd Generation Languages (2GL): Assembly Language

    • Also low-level; uses mnemonics for instructions.
    • Uses symbolic names to represent opcodes and operands.
    • Advantages:
    • Easier to develop, understand, and modify than 1GL.
    • Programs are less prone to errors and easier to maintain.
  • 3rd Generation Languages (3GL): High-Level Language

    • Designed to overcome limitations of 1GL and 2GL.
    • High-level languages let programmers focus on program logic rather than hardware details.
    • Advantages:
    • Easier to develop, learn, and understand.
    • Easier to maintain due to reduced errors.
    • Faster development time compared to 1GL and 2GL.
  • 4th Generation Languages (4GL): Very High-Level Language

    • Very high-level languages aimed at reducing time, cost, and effort to develop software.
    • Advantages:
    • Efficient use of data through database integration.
    • Reduced time, cost, and effort to develop applications.
    • Greater portability of programs compared to earlier generations.
  • ## 5th Generation Languages (5GL): Artificial Intelligence Language

    • Focus on constraint programming; used in AI and neural networks.
    • Advantages:
    • Fast and efficient querying of databases.
    • User can communicate with the computer system in a simple and intuitive manner.

Levels of Programming Languages

  • A low-level language provides little or no abstraction and is close to machine instructions.
    • Examples: assembly language, machine code.
  • A middle-level language interacts with the abstraction layer of a computer system; bridges hardware and higher-level programming.
  • A high-level language is designed to simplify programming; code is easy to read and is compiled or translated to a lower-level form.

Language Family Tree (Key Milestones)

  • 1957–1960s: FORTRAN I, FLOW-MATIC, FORTRAN II, ALGOL 58, ALGOL 60, APL, COBOL
  • 1960s: FORTRAN IV, CPL, SIMULA I, BASIC
  • 1960s–1970s: ALGOL W, SIMULA 67, ALGOL 68, Pascal, BCPL, B
  • 1970s–1980s: C, MODULA-2, FORTRAN 77, Smalltalk 80
  • 1980s–1990s: Ada 83, Ada 95, Oberon, MODULA-3, QuickBASIC, Eiffel, Visual BASIC
  • 1990s–2000s: FORTRAN 90, Java, LISP, Scheme, SNOBOL, ICON, COMMON LISP, C++
  • 1990s–2000s: ANSI C

Examples of Programming Languages (Traditional)

  • FORTRAN (FORmula TRANslation)
    • Developed at IBM in the mid-1950s; designed for scientific and mathematical applications by scientists and engineers.
  • COBOL (COmmon Business Oriented Language)
    • Developed in 1959; designed to be portable across computers; typically used for business applications.
  • BASIC (Beginner’s All-purpose Symbolic Instruction Code)
    • Developed at Dartmouth College in mid-1960s; designed to be simple for students who interact via terminals.
  • C
    • Developed by Bell Laboratories in the early 1970s; provides control and efficiency of assembly language with third-generation features; commonly used for system programming.

Examples of Programming Languages (Object-Oriented)

  • Simula
    • First object-oriented programming language; developed in the 1960s by Ole-Johan Dahl.
  • Smalltalk
    • First purely object-oriented language; developed by Xerox in the mid-1970s; still in use in some systems.
  • C++
    • A C language extension with additional object-oriented features; widely used for system and application software; enables GUI development with visual tools.
  • Java
    • Object-oriented language similar to C++; enables applets that run in browsers; designed for portability and networked environments.

Examples of Programming Languages (Special)

  • Scripting Languages
    • JavaScript, VBScript, PHP, ASP, Perl, Python
  • Command Languages
    • sh, csh, bash
  • Text Processing Languages
    • LaTeX, PostScript, HTML
  • XML (eXtensible Markup Language)
    • A language for defining other languages (definitional, markup-oriented).
  • HTML
    • Used on the Internet and WWW; web page developers insert tags to format pages.

What determines a “good” Programming Language

  • Historically: Run-time performance; computers were expensive relative to programmers.
  • Now: Life cycle cost (human cost) is more important; ease of designing, coding, debugging, maintenance, and reusability are critical.

Criteria of good language design

  • Writability: ability to express computations clearly, correctly, concisely, and quickly.
  • Readability: ease for humans to understand the computation.
  • Orthogonality: features have minimal restrictions and can be combined freely in meaningful ways.
  • Reliability: program behaves predictably and avoids disastrous runs.

cont… Criteria of good language design

  • Maintainability: errors are easy to locate and fix; new features can be added.
  • Generality: avoids special cases; related constructs are unified under general mechanisms.
  • Uniformity: similar features look and behave similarly.
  • Extensibility: language provides mechanisms to add new constructs.

cont… Additional criteria

  • Standardability: programs can be transported across machines with little language-structure changes.
  • Implementability: a translator or interpreter can be written for the language; relates to language definition complexity.

References

  • https://www.includehelp.com/basics/generations-of-programming-language.aspx
  • https://www.computerhope.com/jargon/l/lowlangu.htm
  • https://techterms.com/

Endnotes

  • This set of notes compiles the major and minor points from the transcript, including definitions, generation classifications, language families, examples, and design criteria.