2 Text/ReferencesRobert 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).
4 Why study Programming Language Concepts? Increased capacity to express ideasImproved background for choosing appropriate languagesIncreased ability to learn new languagesBetter understanding of the implementation of conceptsIncreased ability to design new languages
5 Program - DefinitionsA 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
6 Programming DomainsScientific: 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)
7 Programming Paradigms: 1. Imperative Statement oriented languagesEvery statement changes the machine stateComputation is expressed by a sequence of actions.Heavily based on von Neumann architectureProvides variables, assignments, and iterative repetitions.Examples: Fortran, C
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
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 algorithmsExamples: Concurrent C, Java, Fortran-90
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
12 Language Evaluation Criteria ReadabilityWritabilityReliabilityCost
13 ReadabilitySimplicity (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)
14 WritabilitySimplicity/OrthogonalitySupport for abstraction (process abstraction and data abstraction)Expressivity (convenient ways of specifying computation)
15 ReliabilityType 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).
16 CostCost of trainingCost of compiling (Compilation time)Cost of execution (Optimization)Cost of language implementation (Compiler, hardware etc).Cost of maintenance (Repairs, changes and extensions)
17 Implementation Methods 1. Compilation Source ProgramMachine LanguageFetch-ExecuteMachineSource programs are translated to machine language
19 Implementation Methods 2. Pure Interpretation Source ProgramFetch-ExecuteInterpreterVirtual MachineMachineSource programs are directly interpreted by another programwithout any translation.
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)
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++