Cmps5113 Programming Languages Week 1 – lecture 1



Download 19.67 Kb.
Date28.01.2017
Size19.67 Kb.
#9053

CMPS5113 Programming Languages




Week 1 – lecture 1



What is a programming language?

  • systematic notation by which we describe computational processes to others

  • notation for description of algorithms and data structures


computational process – set of steps solve a problem
computer’s built-in abilities: PRIMITIVE/ constitute Machine Language

  • arithmetic and logical operations

  • I/O

  • Some “control” functions



High-level programming languages – less primitive notations/ need system software to translate



What we will study?


  • new/notations -> ex: static, functional relations

  • design/judge quality

  • how a particular language facilitates/impedes certain modes of thought



Why study programming languages?


- linguistic theory states: structure of language defines boundaries of thought ?TRUE?

- language can facilitate or impede certain modes of thought





Benefits of studying languages?


Computer Scientists

  • Improve ability to develop algorithms

  • Improve existing use of language

  • Increase vocabulary of programming constructs

  • Allow choice of language

  • Easier to learn new language

  • Easier to design new language (user interfaces)

Language Designers/Implementers



  • insights from motivation of language facilities to make implementation tradeoffs

Hardware Architects



  • gain insight into ways machines may better support languages

  • design a semantically coherent machine w/ complete sets of data types and operations

System designers



  • apply to human interfaces

  • JCL’s, DB systems, editors, text formatters, debuggers have many characteristics of a programming language

  • Necessary for file systems, linkage editors to interface with programming languages

Software Managers



  • choice of language

  • choice of extension of language or new language and know costs

Early History
1500-3000 B.C. earliest know algorithm on clay tablets in Babylon (near Baghdad, Iraq)

produced mathematical tables

solved algebraic equations using an “algorithm”

at end put “this is the procedure”

did not have conditional tests (no 0 or negative numbers)

did have repetition


300 B.C. Euclid Greece

algorithm for computing GCD of 2 integers (zero still not recognized, so special cases)


19th, early 20th century

    1. Charles Babbage English

2 machines:

- Difference Engine: finite differences, repeated additions, math tables



  • Analytical Engine:many principles of modern computer, any calculation

Store = main memory Mill=ALU barrel = control unit

Early Computer programming languages by category




Numerical


WWII 30/40s “electronic calculators” to solve numerical problems

50s symbolic notations/compilation necessary




    1. Backus’ team – developed FORTRAN

  • numerical calculations

  • full-fledged programming language (control structs, cond, I/O statements)

  • too compete w/ assembly made very efficient!

  • Extremely successful

1958 – Fortran II

Fortran IV

Fortran 77, 90 backwards compatible
Success of FORTRAN -> fear in Europe of domination of IBM


  • leader Naur of (German Math Society)

  • joined by ACM despite fear

  • ALGOL (Algorithmic Language) 58, 60

  • Standard in “academia”

  • GOALS (4)

  • Close to standard math

  • Useful to describe algorithm

  • Compilable

  • Machine independent (no I/O)

  • Not successful

  • MAJOR IMPACT – syntactic notation BNF



Business Languages


  1. Grace Hopper led development CBL (Common Business Language)

COBOL (Common Business Oriented Language)

Revised in 61, 62, standardized in 68, rev. 74, 84



AI Languages


50s

IPL – Info Processing language by Rand Corp (widely known, but use limited)

John McCarthy of MIT designed LISP (List Processing) for IBM 704 => Scheme and Common Lisp


  • list processing FUNCTIONAL Language

  • usual problems: searching

text processing => SNOBOL
Prolog – special purpose based on math logic

Systems Languages


Assembly language

CPL, BCPL – not widespread

C – Unix written mostly in C in 1970s


ROLE of Programming Languages


Early: efficient design - computers and time expensive vs programmers minor cost

60s: machines less expensive, programmers more => need portability, maintainability, ease of use


programming languages evolving

COBOL dropping => application generators

APL, PL/1, SNOBOL – practically disappeared

Pascal – past prime, but continued in Ada

Ada – ground lost to C++ and Java

Delphi and C++ Builder

Fortran revised (for supercomputers)
Influences:


  • capabilities of computers

  • applications: now games, PCs

  • programming methods: envt changes, good methods known now

  • implementation methods -> effect choices of features

  • theory: deepened understanding of strengths and weaknesses

  • standards



TABLE 1.2 on page 11 of text




Week 1 – lecture 2

What makes a good language? Assign HW3: look up principles

Design mechanism still need to be improved

Each language has shortcomings, but reasons for success

Attributes of a Good Language





  1. clarity, simplicity, and unity principles: clear, simple, unified set of concepts and primitives

  2. regularity principle: minimum number of concepts w/ rules for combination being as simple and regular as possible

  3. syntactic consistency: different things look different; same things look the same

Example of violation: ( ) - parm lists and arrays

  1. orthogonality principle

  • independent functions should be controlled by independent mechanisms (symmetric ops vs. overloaded ops

  • ability to combine features in all possible combinations being meaningful (ctrl, alt, shift keys)

  1. naturalness: program structure reflects underlying logical structure of algorithm, provides appropriate structures, ops, natural syntax => proliferation of languages

  2. abstraction

  1. ease of verification: simplicity of semantic and syntactic structure simplifies program testing, review and proofs

  2. programming environment: good language, bad environment => won’t get used

  3. portability: standardized definitions, machine/system independence => no I/O

  4. costs of use

  • cost of program execution

  • cost of translation/ compilation

  • cost of creation, testing and use

  • cost of maintenance



HANDOUT



TABLE 1.2 PAGE 16
APP 60s 90s
Business (What if) Cobol Cobol, spreadsheet, C, 4GLs

Scientific Fortran IV Fortran 90, C++

System Assembler C++

AI (searching) Lisp Common Lisp, Prolog, Scheme, DSS

Publishing Tex, WP, postscript

Process unix shell



New paradigms smalltalk, eiffel - OOP

Web Java, Perl

Download 19.67 Kb.

Share with your friends:




The database is protected by copyright ©ininet.org 2024
send message

    Main page