Chapter 1 Reasons to study concepts of PLs. 1. To Increase ability to learn new languages 2. To Increase ability to design new languages 3. To choose appropriate languages CSCI325 Concept of Programming Languages, Dr Ahmed Rafea 1
Chapter 1 What is a Programming Language? A Programming Language is a notational system for describing computation in machine-readable and human-readable form Computation- Processing Any process that can be carried out by a computer Machine-Readability For a language to be readable, it must have a simple enough structure to allow for efficient translation Human-Readability Unlike machine-readability, this is a much less precise notion, and it is also less understood. It requires that a programming language provide abstractions of the actions of computer that are easy to understand by persons not completely familiar with the underlying details of the machine. CSCI325 Concept of Programming Languages, Dr Ahmed Rafea 2
Chapter 1 Abstractions in Programming Languages -Data abstractions -Basic abstractions -E.g. variables and types -Structured abstraction -E.g. arrays and records -Unit abstraction -E.g. ADT, packages, class, module -Control abstractions -Basic abstractions -E.g. assignment statement -Structured abstraction -E.g. if-statement, procedure declaration and invocation -Unit abstraction -E.g. a collection of procedures, unit, the same as unit-level data abstraction -Parallel Programming -E.g. threads, tasks CSCI325 Concept of Programming Languages, Dr Ahmed Rafea 3
Chapter 1 Computational Paradigms 1. Imperative ( procedural) A programming language that is characterized by the sequential execution of instructions , the use of variables representing memory locations and the use of assignment to change the values of varables is called imperative langauge, the Von Neumann model 2. Functional (applicative) The functional paradigm bases the description of computation on the evaluation of functions or tha application of functions to known values 3. Logic This language paradigm is based on symbolic logic 4. Object-oriented (closely related to imperative) The OOP is based on the notion of object which can be loosely described as a collection of memory locations together with all the operations that can change the values of these memory locations. CSCI325 Concept of Programming Languages, Dr Ahmed Rafea 4
Chapter 1 Language Implementation 1. Compilation - Translate high-level program to machine code - Slow translation - Fast execution 2. Pure interpretation - No translation - Slow execution - Becoming rare 3. Hybrid implementation systems - Small translation cost - Medium execution speed CSCI325 Concept of Programming Languages, Dr Ahmed Rafea 5
Recommend
More recommend