PPL (Unit I)
PPL (Unit I)
PROGRAMMING
LANGUAGES
Presented By
Syed. Thaisin Asst.Professor
CSE-DEPT
VCET
UNIT-I
B.TECH IV CSE- I SEM
SYLLABUS
PRELIMINARY CONCEPTS: REASONS FOR
STUDYING CONCEPTS OF PROGRAMMING
LANGUAGES, PROGRAMMING DOMAINS,
LANGUAGE EVALUATION CRITERIA, INFLUENCES
ON LANGUAGE DESIGN, LANGUAGE CATEGORIES,
LANGUAGE DESIGN TRADE-OFFS,
IMPLEMENTATION METHODS, PROGRAMMING
ENVIRONMENTS, EVOLUTION OF MAJOR
PROGRAMMING LANGUAGES.
SYNTAX AND SEMANTICS: GENERAL PROBLEM OF
DESCRIBING SYNTAX, FORMAL METHODS OF
DESCRIBING SYNTAX, ATTRIBUTE GRAMMARS,
DESCRIBING THE MEANINGS OF PROGRAMS
INTRODUCTION TO PRINCIPLES OF
PROGRAMMING LANGUAGE
ARE YOU AIMING TO BECOME A SOFTWARE ENGINEER ONE DAY?
Markup languages
Such as XHTML
Scripting languages
A list of commands is placed in a file or in XHTML document for
execution
Perl, JavaScript, PHP
Special-purpose languages
Readability
Writability
Reliability
Cost
Other
Readability
One of the most important criteria for judging a
programming language is the ease with which programs
can be read and understood.
Language constructs were designed more from the point
of view of the computer than of computer users
From 1970s, the S/W life cycle concept was developed;
coding was relegated to a much smaller role, and
maintenance was recognized as a major part of the cycle,
particularly in terms of cost. Because ease of maintenance
is determined in large part by readability of programs,
readability became an important measure of the quality of
programs
Characteristics of Readability
Simplicity and orthogonality
Control statements
Datatypes and structures
Syntax considertion
- identifier forms
- special words
- form and meaning
Overall simplicity
Language with too many features is more difficult
to learn
Feature multiplicity is bad. For example: In Java,
increment can be performed if four ways as:
Count= count+1
Count+=1
Count++
++count
Next problem is operator overloading, in which
single operator symbol has more than one meaning
Orthogonality
A relatively small set of primitive constructs that can be
combined in a relatively small number of ways
Consistent set of rules for combining constructs
(simplicity)
Every possible combination is legal
For example, pointers should be able to point to any type
of variable or data structure
Makes the language easy to learn and read
Meaning is context independent
VAX assembly language and Ada are good examples
Lack of orthogonality leads to exceptions to rules
C is littered with special cases
E.g. - structs can be returned from functions but arrays cannot
Orthogonality
1)Computer architecture
2)Programming methodologies
Computer Architecture
We use imperative languages, at least in part, because we
use von Neumann machines
Data and programs stored in same memory
Memory is separate from CPU
Instructions and data are piped from memory to CPU
Basis for imperative languages
LANGUAGE DESIGN
TRADE-OFFS
Compilation
Translates a high-level program to machine code
Slow translation
Fast execution
Separate compilation units must be combined by a linker
into an executable image
(.exe file)
IMPLEMENTATION
METHODS
Pure interpretation
No translation before execution
Slow execution
Loop statements are repeatedly translated
Becoming rare except for web scripting languages
JavaScript
PHP
Hybrid implementation systems
Translates a high-level language to intermediate code, which is interpreted
Each statement is translated only once in contrast to pure interpretation
Medium execution speed
Smalltalk and Java
Intermediate code is called bytecode
The Java interpreter is the JVM
JIT technology now widely used with Java and .NET
The collection of tools used in software development
File system, text editor, compiler, linker
Eclipse
An integrated development environment for Java and
other languages
Microsoft Visual Studio.NET
A large, complex visual environment
Used to program in C#, Visual BASIC.NET, Jscript, J#,
and C++
PROGRAMMING
ENVIRONMENTS