MELJUN CORTES Programming_languages_Introduction to Programming Languages

download MELJUN CORTES Programming_languages_Introduction to Programming Languages

of 6

Transcript of MELJUN CORTES Programming_languages_Introduction to Programming Languages

  • 8/8/2019 MELJUN CORTES Programming_languages_Introduction to Programming Languages

    1/12

    Introduction to Programming Languages

    Programming Languages

    * Property of STI 

    Page 1 of 12

    Classes of Programming

    Languages

     Imperative Languages

    Block-Structured or Procedural Languages

    Object-Oriented Languages

    Languages for Distributed Programming

     Declarative Languages

    Functional or Applicative Languages Logic Programming

    Languages for Databases

  • 8/8/2019 MELJUN CORTES Programming_languages_Introduction to Programming Languages

    2/12

    Introduction to Programming Languages

    Programming Languages

    * Property of STI 

    Page 2 of 12

    Reasons for Studying

    Programming Languages

     To understand the language you are using

     To understand the significance ofprogramming constructs andimplementation

     To make it easier to learn a new language

     To know which programming language touse

     To design a new language easier 

  • 8/8/2019 MELJUN CORTES Programming_languages_Introduction to Programming Languages

    3/12

    Introduction to Programming Languages

    Programming Languages

    * Property of STI 

    Page 3 of 12

    Language Evaluation

    Criteria 

     Readability

    the quality of a language that enables a

    programmer to understand and comprehendthe structure of programs so that they can

     be easily understood and read

    Factors affecting readability:

    Simplicity 

    Orthogonality 

    Control Statement Design

    Syntax 

  • 8/8/2019 MELJUN CORTES Programming_languages_Introduction to Programming Languages

    4/12

    Introduction to Programming Languages

    Programming Languages

    * Property of STI 

    Page 4 of 12

    Language Evaluation

    Criteria 

     Writability

    measure of how easily and conveniently a

    language can be used to create codes orprograms for a particular problem

    Factors affecting writability:

    Simplicity 

    Orthogonality 

     Abstraction

  • 8/8/2019 MELJUN CORTES Programming_languages_Introduction to Programming Languages

    5/12

    Introduction to Programming Languages

    Programming Languages

    * Property of STI 

    Page 5 of 12

    Language Evaluation

    Criteria 

     Reliability

    the ability of a program to perform to its

    specifications under all-possible conditionsor circumstances

    Factors affecting reliability:

     Type checking

    Exception Handling

     Aliasing

    Readability 

     Writability 

  • 8/8/2019 MELJUN CORTES Programming_languages_Introduction to Programming Languages

    6/12

    Introduction to Programming Languages

    Programming Languages

    * Property of STI 

    Page 6 of 12

    Language Evaluation

    Criteria 

      haracteristics of ost

    Programmer training

    Software creation

    Compilation

    Execution

    Compiler cost 

    Poor reliability.

    Maintenance

  • 8/8/2019 MELJUN CORTES Programming_languages_Introduction to Programming Languages

    7/12

    Introduction to Programming Languages

    Programming Languages

    * Property of STI 

    Page 7 of 12

    Influences on

    Language Design

    Computer Architecture

    Most of the popular languages of the last 45

     years have been designed around theprevalent von Neumann architecture

     These languages are called imper tivel ngu ges

     von Neumann computer architecture basics:• stores data and program in the same memory,

     while the CPU which executes instructions is

    separate from memory • instructions and data must be piped from

    memory to the CPU and the results moved back to memory 

    central features of imperative languages are:•  variables which model the memory cell

    • assignment statements based on the pipingoperation

    • operands in expressions are piped frommemory to the CPU, and the result ofevaluating the expression is piped back to thememory cell representing the left side of theassignment 

    • the iterative form of repetition

    • instructions are stored in adjacent cells in

    memory so iteration is fast in this architecture

  • 8/8/2019 MELJUN CORTES Programming_languages_Introduction to Programming Languages

    8/12

    Introduction to Programming Languages

    Programming Languages

    * Property of STI 

    Page 8 of 12

    Influences on

    Language Design

    Programming Methodologies

    1950s and early 1960s: Simple applications

     –  worry about machine efficiency  Late 1960s: People efficiency became

    important  –  readability and better controlstructures

    Late 1970s:•  Top-design and stepwise refinement 

    • Discovery of incompleteness of type checking

    and inadequacy of control statements Middle 1980s: Object-oriented programming

    •  Added inheritance and dynamic method binding which enhance the potential reuse ofexisting software

  • 8/8/2019 MELJUN CORTES Programming_languages_Introduction to Programming Languages

    9/12

    Introduction to Programming Languages

    Programming Languages

    * Property of STI 

    Page 9 of 12

    Implementation

    Methods

     Processor

    composed of circuits that execute a set of

    machine instructions, or macroinstructions Internal Memory

    used by the processor to store data andinstructions

    Layered View of a Computer

  • 8/8/2019 MELJUN CORTES Programming_languages_Introduction to Programming Languages

    10/12

    Introduction to Programming Languages

    Programming Languages

    * Property of STI 

    Page 10 of 12

    Compilation

    translates high-level language programsinto equivalent programs in machine

    language

    COMPILER

     Analysis

    Synthesis

  • 8/8/2019 MELJUN CORTES Programming_languages_Introduction to Programming Languages

    11/12

    Introduction to Programming Languages

    Programming Languages

    * Property of STI 

    Page 11 of 12

    Pure Interpretation

     A method of software simulation whichtranslates high-level language programs by

    interpreting them through softwaresimulation of a computer, using high-levellanguage.

     Advantage:

    allow easy implementation of many source-

    level debugging operations

    Disadvantages:

    slow execution

    requires more space

  • 8/8/2019 MELJUN CORTES Programming_languages_Introduction to Programming Languages

    12/12

    Introduction to Programming Languages

    Programming Languages

    * Property of STI 

    Page 12 of 12

    Hybrid Implementation

    Systems

    source programs into intermediate code-like versions and then decode and

    accomplish them through interpretation

    Intermediate

    CodeGenerator Interpreter Results

    Parse Trees Intermediate Code