![Page 1: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/1.jpg)
Slide 1
Programming Languages Structure
• Introduction
![Page 2: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/2.jpg)
Slide 2
Text/References
• Robert W. Sebesta, “Concepts of Programming Languages”, Fourth Edition Addison-Wesley (1999).
• T.W. Pratt and M.V. Zelkowitz, “Programming Languages – Design and Implementation” Fourth Edition, Prentice-Hall (2001).
• Ravi Sethi, “Programming Languages - Concepts and Constructs” Second Edition, Addison-Wesley (1996).
![Page 3: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/3.jpg)
Slide 3
Course Assessment
• Mid-term Exam 30%
• Project 30%
• Final exam 40%
![Page 4: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/4.jpg)
Slide 4
Why study Programming Language Concepts?
• Increased capacity to express ideas
• Improved background for choosing appropriate languages
• Increased ability to learn new languages
• Better understanding of the implementation of concepts
• Increased ability to design new languages
![Page 5: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/5.jpg)
Slide 5
Program - Definitions
• A program is a description of a set of actions that we want a computer to carry out.
• A program is a model of some process in the real or mathematical world.
• A program is a sequence of instructions for a machine to perform a specific task.
• A notational system for describing computation in machine-readable and human-readable form
![Page 6: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/6.jpg)
Slide 6
Programming Domains
• Scientific: Heavily based on numerical algorithms (Fortran, C)
• Business Applications: Storage, retrieval, and formatting of data, reporting. (COBOL)
• Artificial Intelligence: Symbolic computing, List directed processing (LISP, Prolog)
• Systems Programming: Fast, Low level features (C)• Internet: Web based programming (Perl, Java)• Simulation: Process modeling (MATLAB, GPSS)
![Page 7: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/7.jpg)
Slide 7
Programming Paradigms: 1. Imperative
• Statement oriented languages• Every statement changes the machine state• Computation is expressed by a sequence of
actions.• Heavily based on von Neumann
architecture• Provides variables, assignments, and
iterative repetitions.• Examples: Fortran, C
![Page 8: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/8.jpg)
Slide 8
Programming Paradigms: 2. Declarative
• Problem specification using relations or functions.
• Functional programming (applying functions to given parameters).
• Logic programming (deductive reasoning, rule based)
• Examples: LISP, ML, Haskell, Prolog
![Page 9: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/9.jpg)
Slide 9
Programming Paradigms: 3. Concurrent
• Parallel execution of processes.
• Multi-tasking or multi-threading primitives.
• Inter process communication and synchronization.
• Helps in speeding up the execution of parallel algorithms
• Examples: Concurrent C, Java, Fortran-90
![Page 10: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/10.jpg)
Slide 10
Programming Paradigms: 4. Object Oriented
• Based on the concept of data abstraction.
• Uses encapsulation (data hiding)
• Supports inheritance (software reuse)
• Suitable for programming in the large.
• Examples: C++, Java, Smalltalk, Eiffel
![Page 11: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/11.jpg)
Slide 11
Programming Paradigms: 5. Scripting
• Contains a set of commands (scripts) to be executed.
• Works in conjunction with a larger application, or are interpreted.
• Examples: Perl, Javascript.
![Page 12: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/12.jpg)
Slide 12
Language Evaluation Criteria
• Readability
• Writability
• Reliability
• Cost
![Page 13: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/13.jpg)
Slide 13
Readability
• Simplicity (Small number of basic components, less amount of feature multiplicity, restricted operator overloading).
• Limited Orthogonality (Ways by which primitive constructs can be combined).
• Control Structures (Structured programming)• Data types and structures (Arrays, records..)• Syntax design (Closeness to intended purpose)
![Page 14: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/14.jpg)
Slide 14
Writability
• Simplicity/Orthogonality
• Support for abstraction (process abstraction and data abstraction)
• Expressivity (convenient ways of specifying computation)
![Page 15: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/15.jpg)
Slide 15
Reliability
• Type checking (Compile-time checking of types of variables)
• Exception handling (Ability to intercept errors, take corrective measures and continue).
• Restricted aliasing (Multiple names associated with the same memory cell).
![Page 16: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/16.jpg)
Slide 16
Cost
• Cost of training
• Cost of compiling (Compilation time)
• Cost of execution (Optimization)
• Cost of language implementation (Compiler, hardware etc).
• Cost of maintenance (Repairs, changes and extensions)
![Page 17: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/17.jpg)
Slide 17
Implementation Methods 1. Compilation
Source Program
Machine Language
MachineFetch-Execute
• Source programs are translated to machine language
![Page 18: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/18.jpg)
Slide 18
Implementation Methods 1. Compilation
Source Program
Lexical Analyzer
Syntax Analyzer
Intermediate CodeGenerator
Code Generator
Symbol Table
Lexical units
Parse trees
Optimization
Intermediate code
Machine code
![Page 19: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/19.jpg)
Slide 19
Implementation Methods 2. Pure Interpretation
Source Program
Interpreter
Machine
Fetch-Execute
Virtual Machine
• Source programs are directly interpreted by another program without any translation.
![Page 20: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/20.jpg)
Slide 20
Implementation Methods 3. Hybrid Implementation
• Compilation followed by interpretation.
• Perl (Compiled to detect errors before interpretation)
• Java (Compiled to platform independent byte codes, and interpreted by the JVM)
![Page 21: Slide 1 Programming Languages Structure Introduction](https://reader030.vdocument.in/reader030/viewer/2022032521/56649d585503460f94a379c5/html5/thumbnails/21.jpg)
Slide 21
Programming Environments
• Collection of tools used in the development of software.
• Consists of a file system, a text editor, a linker, a compiler, a debugger, and development tools.
• Helps increase productivity and quality.
• Examples: Borland C++, Visual C++, Visual J++