SlideShare une entreprise Scribd logo
1  sur  47
UNIT 1

             By-
         Garima Jain
   Programming Language: Definition, History ,Feature
   Issues in Language Design
   Structure and Operation of Computer
   Programming Language Paradigms
   Efficiency, Regularity
   Issues in Language Translation
   Syntax and Semantics
   Definition : A notation of a algorithm and data
    structures are called a programming language.
   To improve your ability to develop effective
    algorithms
   To improve your use of existing programming
    languages
   To increase your vocabulary of useful programming
    constructs
   To allow a better choice of programming language
   To make it easier to learn a new language
   To make it easier to design a new language
   1951- 55: Experimental use of expression
    compilers.
   1956- 60: FORTRAN, COBOL, LISP, Algol 60.
   1961- 65: APL notation, Algol 60 (revised),
    SNOBOL, CPL.
   1966- 70: APL, SNOBOL 4, FORTRAN 66,
    BASIC, SIMULA, Algol 68, Algol-W, BCPL.
   1971- 75: Pascal, PL/1 (Standard), C, Scheme,
    Prolog.
   1976- 80: Smalltalk, Ada, FORTRAN 77, ML.
   1981- 85: Smalltalk-80, Prolog, Ada 83.
   1986- 90: C++, SML, Haskell.
   1991- 95: Ada 95, TCL, Perl.
   1996- 2000: Java.
   2000- 05: C#, Python, Ruby, Scala.
Numerically based languages
     Computing mathematical expressions
     FORTRAN, Algol, Pascal, PL/1, BASIC, C, C++


Business languages
     COBOL (Common Business Oriented Language)
     English-like notation
Artificial intelligence languages
     Tree search; Rule-based paradigm
     LISP (LISt Processing)
     PROLOG (PROgramming in LOGic)
System languages
     C, C++
     Script languages: AWK, Perl, TCL/TK
Web programming: HTML, XML, Java,
                     Microsoft *.NET family
Batch processing (batches of files)
     Interactive processing (time sharing)
Effects on language design
     File I/O in batch processing
     Error handling in batch processing
     Time constraints in interactive processing
Interactive processing
     Embedded system environments


Effects on language design
     No need for time sharing
     Good interactive graphics
     Non-standard I/O devices for embedded systems
Client-server model of computing
      Server: a program that provides information
      Client - a program that requests information
Effects on language design
 Interaction between the client and server programs
 Active web pages, Security issues, Performance
   Conceptual integrity
   Orthogonality
   Naturalness for the application
   Support for abstraction
   Ease of program verification
   Programming environment
   Portability of programs
   Cost of use
   Cost of execution.
   Cost of program translation.
   Cost of program creation, testing, and use.
   Cost of program maintenance.
   Design to
     Run efficiently : early languages
     Easy to write correctly : new languages
       Data typing features in ML
       Class of C++
       Package of Ada
   A computer is an integrated set of algorithms and
    data structures capable of storing and executing
    programs.
     Hardware computer or
     virtual computer
•Well-known computer architecture: Von Neumann
• Imperative languages, most dominant, because of
von Neumann computers
– Data and programs stored in memory
– Memory is separate from CPU
– Instructions and data are piped from memory to
CPU
– Basis for imperative languages
• Variables model memory cells
• Assignment statements model piping
• Iteration is efficient
   Hardware realization
     Physical devices
   Firmware realization
     microprogramming
   Software simulation
     Some other programming language
   Combination of these techniques
   Data
     Various kinds of elementary and structured data.
   Primitive operations
   Sequence control
     Controlling the sequence of primitive operations
      execution.
   Data access
     Controlling the data supplied to each execution of
      an operation.
   Storage management
     Controlling the allocation of storage for programs
      and data.
   Operating environment
     Providing mechanisms for communication with
      an external environment containing programs and
      data.
   Main memory
   High-speed register
   High-speed cache memory
   External files

Data and Program
   A set of build-in primitive operations
     Arithmetic operations on each built-in numeric
      data (+,-,*,/)
     Testing various properties of data items (test for
      zero, positive, and negative numbers)
     Accessing and modifying various parts of a data
      item
     Controlling input-output devices
     Sequence control (jumps)
   There is an interpreter :
     Fetch the instruction
     Decode instruction
     Fetch designated operands
     Branch to designated operation
     Execute primitive operations 1 to n


    Using an address register
   Access to operands of the operation
   Keeping all resources of the computer operating as
    much as possible
     Memory
     Central processor
     External data devices


    Multiprogramming
    Cache memory
   The outside world of computer; a set of peripherals
    and input-output devices
   Imperative / procedural languages
   Applicative / functional languages
   Rule-based / declarative languages
   Object-oriented languages
Statement oriented languages that change machine
state
            (C, Pascal, FORTRAN, COBOL)
Computation: a sequence of machine states (contents
of memory)
Syntax: S1, S2, S3, ... where S1, S2, … are statements
Programming consists of building the function that
computes the answer
Computation: Function     composition   is   major
operation (ML, LISP)
Syntax: P1(P2(P3(X)))
Computation: Actions are specified by rules that
check for the presence of certain enabling conditions.
(Prolog)
The order of execution is determined by the enabling
conditions, not by the order of the statements.
Syntax: Condition  Action
Imperative languages that merge applicative design
with imperative statements (Java, C++, Smalltalk)

Syntax: Set of objects (classes) containing data
(imperative concepts) and methods (applicative
concepts)
   Programming language Syntax
       Key criteria concerning syntax
       Basic syntactic concepts
       Overall Program-Subprogram structure
   Stages in Translation
     Analysis of the source program
     Synthesis of the object program
     Bootstrapping
The syntax of a programming language describes the
structure of programs without any consideration of
their meaning.
Readability – a program is considered readable if the
algorithm and data are apparent by
       inspection.
Write-ability – ease of writing the program.
Verifiability – ability to prove program
       correctness (very difficult issue)
Translatability – ease of translating the program
       into executable form.
Lack of ambiguity – the syntax should provide for
       ease of avoiding ambiguous structures
   Character set – The alphabet of the language.
    Several different character sets are used: ASCII,
    EBCIDIC, Unicode
   Identifiers – strings of letters of digits usually
    beginning with a letter
   Operator Symbols – +-*/
   Keywords or Reserved Words – used as a fixed part
    of the syntax of a statement
   Noise words – optional words inserted into statements
    to improve readability
   Comments – used to improve readability and for
    documentation purposes. Comments are usually
    enclosed by special markers
   Blanks – rules vary from language to language.
    Usually only significant in literal strings
   Delimiters – used to denote the beginning and the
    end of syntactic constructs
   Expressions – functions that access data objects in a
    program and return a value
   Statements – these are the sentences of the language,
    they describe a task to be performed
Separate subprogram definitions: Separate
compilation, linked at load time E.g. C/C++
Separate data definitions: General approach in
OOP.
Nested subprogram definitions: Subprogram
definitions appear as declarations within the main
program or other subprograms. E.g. Pascal
Separate interface definitions:
C/C++ header files
Data descriptions separated from executable
statements. A centralized data division contains all data
declarations. E.g. COBOL
Un-separated subprogram definitions: No syntactic
distinction between main program statements and
subprogram statements.
E.g. BASIC
   Analysis of the source program

   Synthesis of the object program

   Bootstrapping
Lexical analysis (scanning) – identifying the tokens of the
programming language: keywords, identifiers, constants
and other symbols

In the program
             void main()
             { printf("Hello Worldn"); }
the tokens are

void, main, (, ), {, printf, (, "Hello Worldn", ), ;, }
Syntactic analysis (parsing) – determining the structure
of the program, as defined by the language grammar.

Semantic analysis - assigning meaning to the syntactic
structures

Example:       int variable1;

meaning: 4 bytes for variable1 , a specific set of
operations to be used with variable1.
The semantic analysis builds the bridge between analysis and
synthesis.

       Basic semantic tasks:

   •   Symbol–table maintenance
   •   Insertion of implicit information
   •   Error detection
   •   Macro processing

Result : an internal representation, suitable to be used for
code optimization and code generation.
Three main steps:

Optimization - Removing redundant statements

Code generation - generating assembler commands with
relative memory addresses for the separate program
modules - obtaining the object code of the program.

Linking and loading - resolving the addresses -
obtaining the executable code of the program.
Assembler code not optimized:
Intermediate code:
                       LOAD_R B
Temp1 = B + C
                       ADD_R C
Temp2 = Temp1 + D
                       STORE_R Temp1
A = Temp2
                       LOAD_R Temp1
                       ADD_R D
                       STORE_R Temp2
                       LOAD_R Temp2
                       STORE_R A
Statements in yellow
can be removed
The compiler for a given language can be written in
the same language.

• A program that translates some internal representation
into assembler code.

• The programmer manually re-writes the compiler into
the internal representation, using the algorithm that is
encoded into the compiler.

From there on the internal representation is translated into
assembler and then into machine language.
   Syntax: what the program looks like.
   Semantics: the meaning given to the various
    syntactic constructs.

    Example:
     V: array [0..9] of integer;
     int V[10];
Unit1 principle of programming language

Contenu connexe

Tendances (20)

Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using Computer
 
Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3
 
Principles of-programming-languages-lecture-notes-
Principles of-programming-languages-lecture-notes-Principles of-programming-languages-lecture-notes-
Principles of-programming-languages-lecture-notes-
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
OOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOPOOP - Benefits and advantages of OOP
OOP - Benefits and advantages of OOP
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Programming paradigm
Programming paradigmProgramming paradigm
Programming paradigm
 
Introduction to Compiler design
Introduction to Compiler design Introduction to Compiler design
Introduction to Compiler design
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3Ppl for students unit 1,2 and 3
Ppl for students unit 1,2 and 3
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Programming Fundamental Presentation
Programming Fundamental PresentationProgramming Fundamental Presentation
Programming Fundamental Presentation
 
Object Oriented Programming Lecture Notes
Object Oriented Programming Lecture NotesObject Oriented Programming Lecture Notes
Object Oriented Programming Lecture Notes
 
Programming in c
Programming in cProgramming in c
Programming in c
 
Assemblers
AssemblersAssemblers
Assemblers
 
C language ppt
C language pptC language ppt
C language ppt
 
Introduction to Compiler Construction
Introduction to Compiler Construction Introduction to Compiler Construction
Introduction to Compiler Construction
 
Uml in software engineering
Uml in software engineeringUml in software engineering
Uml in software engineering
 
Software design
Software designSoftware design
Software design
 

En vedette

Unit 2 Principles of Programming Languages
Unit 2 Principles of Programming LanguagesUnit 2 Principles of Programming Languages
Unit 2 Principles of Programming LanguagesVasavi College of Engg
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming languageVasavi College of Engg
 
Fortran - concise review
Fortran - concise reviewFortran - concise review
Fortran - concise reviewHans Zimermann
 
Life and Work of Dr. John Backus | Turing100@Persistent
Life and Work of Dr. John Backus | Turing100@PersistentLife and Work of Dr. John Backus | Turing100@Persistent
Life and Work of Dr. John Backus | Turing100@PersistentPersistent Systems Ltd.
 
Fortran compiling 2
Fortran compiling 2Fortran compiling 2
Fortran compiling 2najenssr
 
The Universe: A Module in Science and Technology for Grade 5 Pupils
The Universe: A Module in Science and Technology for Grade 5 PupilsThe Universe: A Module in Science and Technology for Grade 5 Pupils
The Universe: A Module in Science and Technology for Grade 5 Pupilscryster
 
Syntactic change through translation: A corpus-based approach to language change
Syntactic change through translation: A corpus-based approach to language changeSyntactic change through translation: A corpus-based approach to language change
Syntactic change through translation: A corpus-based approach to language changeMario Bisiada
 
Syntactic space syntax4generativedesign
Syntactic space syntax4generativedesignSyntactic space syntax4generativedesign
Syntactic space syntax4generativedesignPirouz Nourian
 
Models of teaching
Models of teachingModels of teaching
Models of teachingAileen Asim
 

En vedette (18)

Unit 2 Principles of Programming Languages
Unit 2 Principles of Programming LanguagesUnit 2 Principles of Programming Languages
Unit 2 Principles of Programming Languages
 
Unit 5
Unit 5Unit 5
Unit 5
 
Unit 4
Unit 4Unit 4
Unit 4
 
Unit 3 principles of programming language
Unit 3 principles of programming languageUnit 3 principles of programming language
Unit 3 principles of programming language
 
Fortran - concise review
Fortran - concise reviewFortran - concise review
Fortran - concise review
 
Life and Work of Dr. John Backus | Turing100@Persistent
Life and Work of Dr. John Backus | Turing100@PersistentLife and Work of Dr. John Backus | Turing100@Persistent
Life and Work of Dr. John Backus | Turing100@Persistent
 
Fortran compiling 2
Fortran compiling 2Fortran compiling 2
Fortran compiling 2
 
The Universe: A Module in Science and Technology for Grade 5 Pupils
The Universe: A Module in Science and Technology for Grade 5 PupilsThe Universe: A Module in Science and Technology for Grade 5 Pupils
The Universe: A Module in Science and Technology for Grade 5 Pupils
 
Syntactic change through translation: A corpus-based approach to language change
Syntactic change through translation: A corpus-based approach to language changeSyntactic change through translation: A corpus-based approach to language change
Syntactic change through translation: A corpus-based approach to language change
 
Syntax
SyntaxSyntax
Syntax
 
Syntax Definition
Syntax DefinitionSyntax Definition
Syntax Definition
 
Syntax analysis
Syntax analysisSyntax analysis
Syntax analysis
 
Teaching models
Teaching modelsTeaching models
Teaching models
 
Model of Teaching
Model of TeachingModel of Teaching
Model of Teaching
 
Syntactic space syntax4generativedesign
Syntactic space syntax4generativedesignSyntactic space syntax4generativedesign
Syntactic space syntax4generativedesign
 
Syntax
SyntaxSyntax
Syntax
 
ENGLISH SYNTAX
ENGLISH SYNTAXENGLISH SYNTAX
ENGLISH SYNTAX
 
Models of teaching
Models of teachingModels of teaching
Models of teaching
 

Similaire à Unit1 principle of programming language

computer-science_engineering_principles-of-programming-languages_introduction...
computer-science_engineering_principles-of-programming-languages_introduction...computer-science_engineering_principles-of-programming-languages_introduction...
computer-science_engineering_principles-of-programming-languages_introduction...AshutoshSharma874829
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processorsRebaz Najeeb
 
Programing paradigm & implementation
Programing paradigm & implementationPrograming paradigm & implementation
Programing paradigm & implementationBilal Maqbool ツ
 
Compiler_Lecture1.pdf
Compiler_Lecture1.pdfCompiler_Lecture1.pdf
Compiler_Lecture1.pdfAkarTaher
 
Unit 1_Evaluation Criteria_session 3.pptx
Unit 1_Evaluation Criteria_session 3.pptxUnit 1_Evaluation Criteria_session 3.pptx
Unit 1_Evaluation Criteria_session 3.pptxAsst.prof M.Gokilavani
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introductionRana Ehtisham Ul Haq
 
Compiler Design Introduction
Compiler Design IntroductionCompiler Design Introduction
Compiler Design IntroductionKuppusamy P
 
Cobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptx
Cobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptxCobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptx
Cobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptxmehrankhan7842312
 
Programming content
Programming contentProgramming content
Programming contentBazlin Ahmad
 
CSC103 Intro to Programming
CSC103 Intro to ProgrammingCSC103 Intro to Programming
CSC103 Intro to ProgrammingRichard Homa
 
OOP Comparative Study
OOP Comparative StudyOOP Comparative Study
OOP Comparative StudyDarren Tan
 
CSCorganization of programming languages
CSCorganization of programming languagesCSCorganization of programming languages
CSCorganization of programming languagesOluwafolakeOjo
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterHossam Hassan
 
Language translators
Language translatorsLanguage translators
Language translatorsAditya Sharat
 

Similaire à Unit1 principle of programming language (20)

computer-science_engineering_principles-of-programming-languages_introduction...
computer-science_engineering_principles-of-programming-languages_introduction...computer-science_engineering_principles-of-programming-languages_introduction...
computer-science_engineering_principles-of-programming-languages_introduction...
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processors
 
Programing paradigm & implementation
Programing paradigm & implementationPrograming paradigm & implementation
Programing paradigm & implementation
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Compiler_Lecture1.pdf
Compiler_Lecture1.pdfCompiler_Lecture1.pdf
Compiler_Lecture1.pdf
 
Unit 1_Evaluation Criteria_session 3.pptx
Unit 1_Evaluation Criteria_session 3.pptxUnit 1_Evaluation Criteria_session 3.pptx
Unit 1_Evaluation Criteria_session 3.pptx
 
Compiler Construction introduction
Compiler Construction introductionCompiler Construction introduction
Compiler Construction introduction
 
Compiler Design Introduction
Compiler Design IntroductionCompiler Design Introduction
Compiler Design Introduction
 
Cobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptx
Cobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptxCobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptx
Cobbbbbbbnnnnnnnnnnnnnnnnncepts of PL.pptx
 
Programming content
Programming contentProgramming content
Programming content
 
CSC103 Intro to Programming
CSC103 Intro to ProgrammingCSC103 Intro to Programming
CSC103 Intro to Programming
 
OOP Comparative Study
OOP Comparative StudyOOP Comparative Study
OOP Comparative Study
 
Unit 1
Unit 1Unit 1
Unit 1
 
FINAL.ppt
FINAL.pptFINAL.ppt
FINAL.ppt
 
CSCorganization of programming languages
CSCorganization of programming languagesCSCorganization of programming languages
CSCorganization of programming languages
 
Cpcs302 1
Cpcs302  1Cpcs302  1
Cpcs302 1
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
 
df
dfdf
df
 
Language translators
Language translatorsLanguage translators
Language translators
 
Prgramming paradigms
Prgramming paradigmsPrgramming paradigms
Prgramming paradigms
 

Dernier

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 

Dernier (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 

Unit1 principle of programming language

  • 1. UNIT 1 By- Garima Jain
  • 2. Programming Language: Definition, History ,Feature  Issues in Language Design  Structure and Operation of Computer  Programming Language Paradigms  Efficiency, Regularity  Issues in Language Translation  Syntax and Semantics
  • 3. Definition : A notation of a algorithm and data structures are called a programming language.
  • 4. To improve your ability to develop effective algorithms  To improve your use of existing programming languages  To increase your vocabulary of useful programming constructs  To allow a better choice of programming language  To make it easier to learn a new language  To make it easier to design a new language
  • 5. 1951- 55: Experimental use of expression compilers.  1956- 60: FORTRAN, COBOL, LISP, Algol 60.  1961- 65: APL notation, Algol 60 (revised), SNOBOL, CPL.  1966- 70: APL, SNOBOL 4, FORTRAN 66, BASIC, SIMULA, Algol 68, Algol-W, BCPL.  1971- 75: Pascal, PL/1 (Standard), C, Scheme, Prolog.  1976- 80: Smalltalk, Ada, FORTRAN 77, ML.
  • 6. 1981- 85: Smalltalk-80, Prolog, Ada 83.  1986- 90: C++, SML, Haskell.  1991- 95: Ada 95, TCL, Perl.  1996- 2000: Java.  2000- 05: C#, Python, Ruby, Scala.
  • 7. Numerically based languages Computing mathematical expressions FORTRAN, Algol, Pascal, PL/1, BASIC, C, C++ Business languages COBOL (Common Business Oriented Language) English-like notation
  • 8. Artificial intelligence languages Tree search; Rule-based paradigm LISP (LISt Processing) PROLOG (PROgramming in LOGic) System languages C, C++ Script languages: AWK, Perl, TCL/TK Web programming: HTML, XML, Java, Microsoft *.NET family
  • 9. Batch processing (batches of files) Interactive processing (time sharing) Effects on language design File I/O in batch processing Error handling in batch processing Time constraints in interactive processing
  • 10. Interactive processing Embedded system environments Effects on language design No need for time sharing Good interactive graphics Non-standard I/O devices for embedded systems
  • 11. Client-server model of computing Server: a program that provides information Client - a program that requests information Effects on language design Interaction between the client and server programs Active web pages, Security issues, Performance
  • 12. Conceptual integrity  Orthogonality  Naturalness for the application  Support for abstraction  Ease of program verification  Programming environment  Portability of programs  Cost of use  Cost of execution.  Cost of program translation.  Cost of program creation, testing, and use.  Cost of program maintenance.
  • 13. Design to  Run efficiently : early languages  Easy to write correctly : new languages  Data typing features in ML  Class of C++  Package of Ada
  • 14. A computer is an integrated set of algorithms and data structures capable of storing and executing programs.  Hardware computer or  virtual computer
  • 15. •Well-known computer architecture: Von Neumann • Imperative languages, most dominant, because of von Neumann computers – Data and programs stored in memory – Memory is separate from CPU – Instructions and data are piped from memory to CPU – Basis for imperative languages • Variables model memory cells • Assignment statements model piping • Iteration is efficient
  • 16.
  • 17. Hardware realization  Physical devices  Firmware realization  microprogramming  Software simulation  Some other programming language  Combination of these techniques
  • 18. Data  Various kinds of elementary and structured data.  Primitive operations  Sequence control  Controlling the sequence of primitive operations execution.
  • 19. Data access  Controlling the data supplied to each execution of an operation.  Storage management  Controlling the allocation of storage for programs and data.  Operating environment  Providing mechanisms for communication with an external environment containing programs and data.
  • 20. Main memory  High-speed register  High-speed cache memory  External files Data and Program
  • 21. A set of build-in primitive operations  Arithmetic operations on each built-in numeric data (+,-,*,/)  Testing various properties of data items (test for zero, positive, and negative numbers)  Accessing and modifying various parts of a data item  Controlling input-output devices  Sequence control (jumps)
  • 22. There is an interpreter :  Fetch the instruction  Decode instruction  Fetch designated operands  Branch to designated operation  Execute primitive operations 1 to n Using an address register
  • 23. Access to operands of the operation
  • 24. Keeping all resources of the computer operating as much as possible  Memory  Central processor  External data devices Multiprogramming Cache memory
  • 25. The outside world of computer; a set of peripherals and input-output devices
  • 26. Imperative / procedural languages  Applicative / functional languages  Rule-based / declarative languages  Object-oriented languages
  • 27. Statement oriented languages that change machine state (C, Pascal, FORTRAN, COBOL) Computation: a sequence of machine states (contents of memory) Syntax: S1, S2, S3, ... where S1, S2, … are statements
  • 28. Programming consists of building the function that computes the answer Computation: Function composition is major operation (ML, LISP) Syntax: P1(P2(P3(X)))
  • 29. Computation: Actions are specified by rules that check for the presence of certain enabling conditions. (Prolog) The order of execution is determined by the enabling conditions, not by the order of the statements. Syntax: Condition  Action
  • 30. Imperative languages that merge applicative design with imperative statements (Java, C++, Smalltalk) Syntax: Set of objects (classes) containing data (imperative concepts) and methods (applicative concepts)
  • 31. Programming language Syntax  Key criteria concerning syntax  Basic syntactic concepts  Overall Program-Subprogram structure  Stages in Translation  Analysis of the source program  Synthesis of the object program  Bootstrapping
  • 32. The syntax of a programming language describes the structure of programs without any consideration of their meaning.
  • 33. Readability – a program is considered readable if the algorithm and data are apparent by inspection. Write-ability – ease of writing the program. Verifiability – ability to prove program correctness (very difficult issue) Translatability – ease of translating the program into executable form. Lack of ambiguity – the syntax should provide for ease of avoiding ambiguous structures
  • 34. Character set – The alphabet of the language. Several different character sets are used: ASCII, EBCIDIC, Unicode  Identifiers – strings of letters of digits usually beginning with a letter  Operator Symbols – +-*/  Keywords or Reserved Words – used as a fixed part of the syntax of a statement
  • 35. Noise words – optional words inserted into statements to improve readability  Comments – used to improve readability and for documentation purposes. Comments are usually enclosed by special markers  Blanks – rules vary from language to language. Usually only significant in literal strings
  • 36. Delimiters – used to denote the beginning and the end of syntactic constructs  Expressions – functions that access data objects in a program and return a value  Statements – these are the sentences of the language, they describe a task to be performed
  • 37. Separate subprogram definitions: Separate compilation, linked at load time E.g. C/C++ Separate data definitions: General approach in OOP. Nested subprogram definitions: Subprogram definitions appear as declarations within the main program or other subprograms. E.g. Pascal
  • 38. Separate interface definitions: C/C++ header files Data descriptions separated from executable statements. A centralized data division contains all data declarations. E.g. COBOL Un-separated subprogram definitions: No syntactic distinction between main program statements and subprogram statements. E.g. BASIC
  • 39. Analysis of the source program  Synthesis of the object program  Bootstrapping
  • 40. Lexical analysis (scanning) – identifying the tokens of the programming language: keywords, identifiers, constants and other symbols In the program void main() { printf("Hello Worldn"); } the tokens are void, main, (, ), {, printf, (, "Hello Worldn", ), ;, }
  • 41. Syntactic analysis (parsing) – determining the structure of the program, as defined by the language grammar. Semantic analysis - assigning meaning to the syntactic structures Example: int variable1; meaning: 4 bytes for variable1 , a specific set of operations to be used with variable1.
  • 42. The semantic analysis builds the bridge between analysis and synthesis. Basic semantic tasks: • Symbol–table maintenance • Insertion of implicit information • Error detection • Macro processing Result : an internal representation, suitable to be used for code optimization and code generation.
  • 43. Three main steps: Optimization - Removing redundant statements Code generation - generating assembler commands with relative memory addresses for the separate program modules - obtaining the object code of the program. Linking and loading - resolving the addresses - obtaining the executable code of the program.
  • 44. Assembler code not optimized: Intermediate code: LOAD_R B Temp1 = B + C ADD_R C Temp2 = Temp1 + D STORE_R Temp1 A = Temp2 LOAD_R Temp1 ADD_R D STORE_R Temp2 LOAD_R Temp2 STORE_R A Statements in yellow can be removed
  • 45. The compiler for a given language can be written in the same language. • A program that translates some internal representation into assembler code. • The programmer manually re-writes the compiler into the internal representation, using the algorithm that is encoded into the compiler. From there on the internal representation is translated into assembler and then into machine language.
  • 46. Syntax: what the program looks like.  Semantics: the meaning given to the various syntactic constructs. Example: V: array [0..9] of integer; int V[10];