0% found this document useful (0 votes)
80 views33 pages

1-Introduction Preliminaries of PPL

The document discusses the basics of programming languages including what a computer system includes, the difference between low-level and high-level languages, important programming languages, factors that influence language design, different language categories and implementation methods, and language evaluation criteria.

Uploaded by

SimbaBabdu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views33 pages

1-Introduction Preliminaries of PPL

The document discusses the basics of programming languages including what a computer system includes, the difference between low-level and high-level languages, important programming languages, factors that influence language design, different language categories and implementation methods, and language evaluation criteria.

Uploaded by

SimbaBabdu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Principles of Programming

Languages(CS F301)
Prof.R.Gururaj
BITS Pilani CS&IS Dept.
Hyderabad Campus
Computer System

What a computer system includes


 Processor(CPU)
 Memory
 Input- Key board, Mouse etc.
 Output- Monitor, Printer etc.
 Memory (sec)
 OS and
 SW

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Computers for Solving Problems

 Problem statement
 Algorithm
 Program
 Machine instructions
 Execution

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Algorithm

Is a step-by-step procedure (to solve problems)


generated to terminate such that each step is
precisely stated and carried out by the
computer.

Is a finite set of instructions which if followed


accomplishes a particular task.

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Low-level Language

Low-level Language is tied to the computer hardware


(machine dependent).
Each computer (HW) will have one such low-level language
we call such language as Assembly Language ( in
addition to its Machine Language).

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


High-level Language

High-level Languages are at a distance from the


computer(machine independent)
High-level programming languages allow the specification
of a problem solution in terms closer to those used by
human beings.
These languages were designed to make programming far
easier, less error-prone and to remove the programmer
from having to know the details of the internal structure
of a particular computer.

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Advantages of High-level
Programming Languages
High-level languages allow us to use symbolic
names for values.
High-level languages provide expressiveness.
 High-level languages enhance readability.
High-level language provide abstraction of the
underlying HW.
High-level languages safeguard against bugs.

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Some important Programming
Languages
BASIC, PROLOG, LISP
C,
C++,
Cobol,
FORTRAN,
Java,
Pascal,
Perl,
PHP,
Python,
Ruby, and Visual Basic.
Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus
Principles
of
Programming Languages
(PPL)

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Preliminaries (Ch.1 of T1)

Why to study Concepts of Programming languages ?


1. Increased Capacity to express ideas.
2. Improved background for choosing appropriate PL.
3. Increased ability to learn new languages.
4. Better understanding of the significance of implementation.
5. Better use of languages you already know.
6. Overall advancement of Computing.

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Programming Domains
• Scientific Applications
Arrays, Matrices, Loops, selections, large number of Floating point
operations are the requirement.
Fortran (FORmula TRANslation) 1950s; ALGOL 60
• Business Applications
Producing reports, precise way to specify and store decimal and character
data.
COBOL (COmmon Business-Oriented Language).
• Artificial intelligence
LISP (LISt Processing) 1965.
• System Programming
OS and other support tools of computer are called as System SW.
UNIX is completely written in C (ISO 1999).
• Web Software
PHP, Python, Java Script with HTML

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Language evaluation Criteria
1.Readability
2. Writability
3. Reliability
4. Cost

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


1.Readability is affected by -
o Overall simplicity
o Orthogonality
o Data types
o Syntax Design

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus
Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus
Example for Orthogonality

Assembly language for IBM mainframe

VAX series minicomputer

Hence VAX language is considered to be more orthogonal.

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


2. Writability
o Simplicity & Orthogonality
o Abstraction
o Expressivity

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


3. Reliability
o Type checking
o Exception handling
o Aliasing
o Readability & Writability

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


4. Cost
o Training
o Creating SW
o Compilation cost
o Execution cost
o Language implementation system
o Poor reliability
o Maintenance

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


What influence Language Design
1.Computer Architecture
2. Programming Design Methodologies

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


1. Influence of Computer Architecture on Language design
o Von Neumann Architecture (since 1940)

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


2. Programming Design Methodologies
o Inadequacies in type checking, use of goto.
o 1970 data-oriented or OO paradigm- needs support for
important concept called abstraction.
o Need for Concurrent programming

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Language categories
1. Imperative Languages (Procedure-oriented)
2. Functional Languages
3. Logic Languages
4. OOP Languages
5. Scripting Languages
6. Mark-up Languages

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Language Design trade-offs
1. Writability vs. Reliability (ex. Pointers, large no of
operators)
2. Reliabilty vs. cost of execution (ex. Array bound
check)
3. Compilation cost vs. execution cost

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Language Implementtaion
Methods
1. Compilation
2. Interpretation
3. Hybrid approach
4. Pre Processors

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Language Processors

Compiler: It is a program that reads a program written in one


language (source language) and translates it into an equivalent
program in another language(target language).

It also reports errors in the source program.

It is a Software system for translation.

Prof.R.Gururaj CSF363 Compiler Construction BITS Pilani, Hyderabad Campus


Compilation

Java, C, C++ etc

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Translation Process

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Language Processors

Interpreter: Instead of producing a target program, it directly


executes the operations specified in the source program on
inputs supplied by the user and produces output.
With this approach, the programs are interpreted by another
program called an interpreter. No translation required.
The interpreter program acts as a SW simulator of machine
whose fetch-decode-execute deals with high-level-program
statements rather than machine instructions.
This SW simulation provides a VM for the language.
Debugging is easy.
But slow because interpretation must happen every time you
execute the program.
A Hybrid approach: In java the byte code is interpreted by JVM.

Prof.R.Gururaj CSF363 Compiler Construction BITS Pilani, Hyderabad Campus


Interpretation

EX: LISP, JavaScript, PHP

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Hybrid Approach

Ex: Java

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Programming Environments
A Programming Environment is the collection of tools that help in developing SW.
Ex. Editor, Compiler, Linker, Libraries etc.

1. Jbuilder
2. .NET
3. UNIX
4. NetBeans
5. Eclipse

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus


Ch.1 Summary
1. Why study PPL?
2. Programing Domains.
3. Language Evaluation Criteria.
4. Influences on Language Design
5. Language Categories.
6. Design Trade-offs.
7. Implementation Methods.
8. Environments

Prof.R.Gururaj CSF301 PPL BITS Pilani, Hyderabad Campus

You might also like