1 / 10

CSCE 531 Compiler Construction Final Lecture of the Semester

CSCE 531 Compiler Construction Final Lecture of the Semester. Spring 2010 Marco Valtorta mgv@cse.sc.edu. Acknowledgment. The slides are based on the textbook and other sources, including slides from Bent Thomsen’s course at the University of Aalborg in Denmark and several other fine textbooks

Download Presentation

CSCE 531 Compiler Construction Final Lecture of the Semester

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSCE 531Compiler ConstructionFinal Lecture of the Semester Spring 2010 Marco Valtorta mgv@cse.sc.edu

  2. Acknowledgment • The slides are based on the textbook and other sources, including slides from Bent Thomsen’s 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”) • First edition, without the second author, was published in 1988 • 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 Web-Browser PHP Script 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? • Increased capacity to express ideas • Improved background for choosing appropriate languages • Increased ability to learn new languages • Better understanding of the significance of implementation • Increased ability to design new languages • Background for compiler writing • Overall advancement of computing • Distinguish essential from accidental features

More Related