Presentation is loading. Please wait.

Presentation is loading. Please wait.

Principles of Programming Languages

Similar presentations


Presentation on theme: "Principles of Programming Languages"— Presentation transcript:

1 Principles of Programming Languages

2 The Structure And Operation Of A Computer
A computer is an integrated set of algorithms and data structures capable of storing and executing programs. Hardware computer Virtual computer

3 The von Neumann Architecture

4 Major Components of a Computer
Data Various kinds of elementary and structured data. Primitive operations Sequence control Controlling the sequence of primitive operations execution. Data access Controlling the data supplied to each execution of an operation.

5 Major Components of a Computer
Storage management Controlling the allocation of storage for programs and data. Main memory Main memory Register High-speed cache memory External files Operating environment Providing mechanisms for communication with an external environment containing programs and data.

6 Operations A set of build-in primitive operations
Arithmetic operations on each built-in numeric data (+,-,*,/) Testing various properties of data items (test for zero, positive, and negative numbers) Accessing and modifying various parts of a data item Controlling input-output devices Sequence control (jumps)

7 Sequence Control There is an interpreter : Fetch the instruction
Decode instruction Fetch designated operands Branch to designated operation Execute primitive operations 1 to n Using an address register

8 Software architectures 1. Mainframe era
Batch processing (batches of files) Interactive processing (time sharing)  Effects on language design File I/O in batch processing Error handling in batch processing Time constraints in interactive processing

9 2. Personal computers Effects on language design
Interactive processing Embedded system environments     Effects on language design No need for time sharing Good interactive graphics Non-standard I/O devices for embedded systems

10 3. Networking era (Client-server model of computing)
Server: a program that provides information Client - a program that requests information  Effects on language design Interaction between the client and server programs Active web pages, Security issues, Performance

11 LANGUAGE DEVELOPMENT Numerically based languages Business languages
Computing mathematical expressions FORTRAN, Algol, Pascal, PL/1, BASIC, C, C++wrk Numerically based languages COBOL (Common Business Oriented Language) English-like notation Business languages Tree search; Rule-based paradigm LISP (LISt Processing) PROLOG (PROgramming in LOGic) Artificial intelligence languages System languages Web programming C, C++ and Script languages: AWK, Perl, TCL/TK HTML, XML, PHP

12 LANGUAGE DESIGN ISSUES
Languages are designed to: Languages in the earlier era were designed to run efficiently Languages in the new era are designed to be written correctly with minimum lines of code Data typing features in ML Class of C++ Package of Ada DESIGN GOALS During 1950s--1960s - Run-time considerations Programmers are cheap, machines expensive; Keep the machine busy Today - program development time considerations CPU power and memory are very cheap

13 Attributes of a good language
Conceptual integrity Orthogonality Naturalness for the application Support for abstraction Ease of program verification Programming environment Portability of programs Cost of use Cost of execution. Cost of program translation. Cost of program creation, testing, and use. Cost of program maintenance.

14 Language paradigms Imperative / procedural languages
Applicative / functional languages Rule-based / declarative languages Object-oriented languages

15 Imperative / procedural languages
Statement oriented languages that change machine state (C, Pascal, FORTRAN, COBOL) Computation: a sequence of machine states (contents of memory) Syntax: S1, S2, S3, ... where S1, S2, … are statements

16 Applicative / functional languages
Programming consists of building the function that computes the answer Computation: Function composition is major operation (ML, LISP) Syntax: P1(P2(P3(X)))

17 Rule-based / declarative languages
Computation: Actions are specified by rules that check for the presence of certain enabling conditions. (Prolog) The order of execution is determined by the enabling conditions, not by the order of the statements. Syntax: Condition  Action

18 Object-oriented languages
Imperative languages that merge applicative design with imperative statements (Java, C++, Smalltalk) Syntax: Set of objects (classes) containing data (imperative concepts) and methods (applicative concepts)


Download ppt "Principles of Programming Languages"

Similar presentations


Ads by Google