CSCE 531 Compiler Construction Final Lecture of the Semester - PowerPoint PPT Presentation

About This Presentation
Title:

CSCE 531 Compiler Construction Final Lecture of the Semester

Description:

The s are based on the textbook and other sources, ... Reply. WWW. Submit. Data. Call PHP. interpreter. Response. Response. LAN. Web-Browser. Database ... – PowerPoint PPT presentation

Number of Views:80
Avg rating:3.0/5.0
Slides: 11
Provided by: MarcoVa
Learn more at: https://cse.sc.edu
Category:

less

Transcript and Presenter's Notes

Title: CSCE 531 Compiler Construction Final Lecture of the Semester


1
CSCE 531Compiler ConstructionFinal Lecture of
the Semester
  • Spring 2008
  • Marco Valtorta
  • mgv_at_cse.sc.edu

2
Acknowledgment
  • The slides are based on the textbook and other
    sources, including slides from Bent Thomsens
    course at the University of Aalborg in Denmark
    and several other fine textbooks
  • The three main other compiler textbooks I
    considered are
  • Aho, Alfred V., Monica S. Lam, Ravi Sethi, and
    Jeffrey D. Ullman. Compilers Principles,
    Techniques, Tools, 2nd ed. Addison-Welsey,
    2007. (The dragon book)
  • Appel, Andrew W. Modern Compiler Implementation
    in Java, 2nd ed. Cambridge, 2002. (Editions in
    ML and C also available the tiger books)
  • Grune, Dick, Henri E. Bal, Ceriel J.H. Jacobs,
    and Koen G. Langendoen. Modern Compiler Design.
    Wiley, 2000

3
Efficiency
  • Efficiency is especially an issue for register
    machines
  • Example 9.5
  • Hand-developed assembly code is faster
  • Code transformations (optimizations)
  • Constant folding, including address folding for
    arrays and records (ex. 9.6)
  • Common expression elimination (ex. 9.7)
  • Code movement (ex. 9.8)

4
Blocks and Data Flow Analysis
  • Handout (dragon books 9.4 1988)
  • Partition into basic blocks
  • Transformation on basic blocks
  • Common subexpression elimination
  • Dead code elimination
  • Renaming of temporary variables
  • Interchange of two independent adjacent
    statements
  • Basic blocks form a flow graph

5
Live Variable Analysis
  • Handout (dragon book 9.2.5 2007)
  • Could variable x at point p be used along some
    path in the flow graph starting at p?

6
Language Lifecycle
  • Language processors do not exist in a vacuum
  • Waterfall, Iterative Development, RUDE
  • Support for programming in the large and
    programming in the small is necessary
  • This goes beyond compiler design
  • Waterfall requires support for design-by-contract
  • Iterative development requires support for
    prototyping
  • RUDE may be better supported by weaker typing

7
Interpreters are everywhere on the web
Web-Client
Database Server
Web-Server
HTML-Form (JavaScript)
Call PHP interpreter
WWW
DBMS
Submit Data
LAN
PHP Script
Web-Browser
SQL commands
Response
Response
Database Output
Reply
8
Parallel Programming
  • People still we do not know how to do parallel
    programming in an imperative style, and the
    machines are catching up!
  • Solution 1 use a functional or logical style
  • Solution 2 concentrate on numerical computation
  • Solution 3 support specific computer
    architectures

9
Compilers, Language Design, and Specifications
  • It is hard to write informal specifications that
    are unambiguous
  • Example repeat until exercise
  • It seems impossible to teach a compiler course
    without also teaching language design
  • Example recursive data types

10
Why Study PL Concepts?
  1. Increased capacity to express ideas
  2. Improved background for choosing appropriate
    languages
  3. Increased ability to learn new languages
  4. Better understanding of the significance of
    implementation
  5. Increased ability to design new languages
  6. Background for compiler writing
  7. Overall advancement of computing
  8. Distinguish essential from accidental features
Write a Comment
User Comments (0)
About PowerShow.com