0% found this document useful (0 votes)
23 views

Introduction

This document provides an introduction to principles of programming languages. It discusses why understanding programming languages is important, including for expressing ideas, choosing appropriate languages, learning new languages, and advancing computing. It also outlines some key programming domains and criteria for evaluating languages, including readability, writability, and reliability. Characteristics like simplicity, orthogonality, data types, syntax design, abstraction, expressivity, and type checking are examined in more depth.

Uploaded by

PRATIKSH KUMAR
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Introduction

This document provides an introduction to principles of programming languages. It discusses why understanding programming languages is important, including for expressing ideas, choosing appropriate languages, learning new languages, and advancing computing. It also outlines some key programming domains and criteria for evaluating languages, including readability, writability, and reliability. Characteristics like simplicity, orthogonality, data types, syntax design, abstraction, expressivity, and type checking are examined in more depth.

Uploaded by

PRATIKSH KUMAR
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Introduction

Principles of Programming Language

S.Venkatesan

Reference: Robert W. Sebesta, Concepts of Programming Languages, 10th Edition, Pearson


Why?
• Increased Capacity to express Ideas.

• Improved Background for choosing appropriate languages.

• Increased ability to learn new languages.

• Better understanding of the significance of implementation.

• Better use of languages that are already known.

• Overall advancement of computing.


Programming Domains
• Scientific Applications

• Business Applications

• Artificial Intelligence

• System Programming

• Web Software
Evaluation Criteria & Characteristic
• Criteria
– Readability
– Writability
– Reliability

• Characteristic
– Simplicity -
– Orthogonality
– Data types
– Syntax Design
– Support for abstraction
– Expressivity
– Type Checking
– Exception Handling
– Restricted aliasing
Readability
• Programs that can be read and understood.

• Earlier that is before 1970, efficiency was the only point of


view.

• After 1970, the coding was relegated to a much smaller role


and maintenance become a major role. (according to the
software life cycle concept by Grady Booch, 1987).

• Readability must be considered in the context of the problem


domain.
Simplicity
• Simplicity affects the readability

• Like feature multiplicity


– count = count + 1
– count += 1
– count++
– ++ count

• Operator Overloading
Orthogonality
• Independent of the context.
Data Type
• Adequate facilities for defining data types and data
structures in a language is required.

• For example, a numeric type is used for boolean


– timeout = 1

• However, for language having boolean type we can


write
– timeout = true
Syntax Design
• Special Words
– Confusion if reserved words allowed for user defined variable
names. For example, fortran – Do and End can be variable.
– Compound statements with brace is confusing compare to
end if and end loop

• Form and Meaning


– Semantics or meaning, should follow directly from syntax or
form.
– Problematic – grep in UNIX
Writability
• It is a measure of how easily a language can be
used to create programs for a chosen problem
domain.
Simplicity and Orthogonality
• Large number of constructs might not be
familiar with all of them.

• Too much orthogonality can be a detriment to


writability.

• Errors is program can go undetected when


nearly any combination of primitives is legal.
Support for Abstraction
• Process Abstraction
– Use of a subprogram. For example, inserting the sort algorithm in all
places as per need.

– Otherwise program will be longer or cluttered if we repeat writing it.

• Data Abstraction
– For example writing a binary tree that stores integer data in its node.

– The complexity of writing such program in non-pointer supported


languages.
Expressivity
• Powerful operations can be accomplished with
a complex statements
– count++
– count = count + 1
Reliability
• Type Checking – Compile or Run time

• Exception Handling

• Aliasing – two or more distinct names that can


be used to access the same memory cell.

• Readability and Writability - Maintenace


Cost
• Training Programmers.

• Cost of writing programs.

• Cost of Compiling programs – Optimization

• Expensive Hardware – can run on it.

• Poor reliability – cost of failure in critical system.

• Maintenance.

• In general – development, maintenance and reliability. Also portability


Compiler
Pure Interpreter
Hybrid Implementation
End of Preliminaries

You might also like