COMP Compilers Lecture 1: Introduction

Slides:



Advertisements
Similar presentations
Introduction to Compiler Construction
Advertisements

1 CIS 461 Compiler Design and Construction Fall 2014 Instructor: Hugh McGuire slides derived from Tevfik Bultan, Keith Cooper, and Linda Torczon Lecture-Module.
Software & Services Group, Developer Products Division Copyright© 2010, Intel Corporation. All rights reserved. *Other brands and names are the property.
SYSTEM PROGRAMMING & SYSTEM ADMINISTRATION
Compiler Construction by Muhammad Bilal Zafar (AP)
Goran Šuković, University of Montenegro 1/21 Compiler Construction Course at University of Montenegro 7 th Workshop on “Software Engineering Education.
Lecture 01 - Introduction Eran Yahav 1. 2 Who? Eran Yahav Taub 734 Tel: Monday 13:30-14:30
Compiler Construction
Compiler Construction
Introduction & Overview CS4533 from Cooper & Torczon.
Overview of the Course. Critical Facts Welcome to CISC 672 — Advanced Compiler Construction Instructor: Dr. John Cavazos Office.
410/510 1 of 20 Week 1 – Lecture 1 Introduction The Textbook Assessment Programming & Tools A v. small compiler Compiler Construction.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Principles of Compiler Design
Chapter 1. Introduction.
Overview of the Course Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University.
Overview of the Course Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University.
Introduction to Compiler Construction Robert van Engelen COP5621 Compiler Construction Copyright Robert.
Compiler course 1. Introduction. Outline Scope of the course Disciplines involved in it Abstract view for a compiler Front-end and back-end tasks Modules.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
May 31, May 31, 2016May 31, 2016May 31, 2016 Azusa, CA Sheldon X. Liang Ph. D. Computer Science at Azusa Pacific University Azusa Pacific University,
1 EECS 6083 Compiler Theory Based on slides from text web site: Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved.
Compiler design Lecture 1: Compiler Overview Sulaimany University 2 Oct
The course. Description Computer systems programming using the C language – And possibly a little C++ Translation of C into assembly language Introduction.
Chapter 1 Introduction. Chapter 1 - Introduction 2 The Goal of Chapter 1 Introduce different forms of language translators Give a high level overview.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
CS 460/660 Compiler Construction. Class 01 2 Why Study Compilers? Compilers are important – –Responsible for many aspects of system performance Compilers.
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
1 Compiler Design (40-414)  Main Text Book: Compilers: Principles, Techniques & Tools, 2 nd ed., Aho, Lam, Sethi, and Ullman, 2007  Evaluation:  Midterm.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Compiler Construction (CS-636)
 Programming - the process of creating computer programs.
Chapter – 8 Software Tools.
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
Objective of the course Understanding the fundamentals of the compilation technique Assist you in writing you own compiler (or any part of compiler)
COMP 3002: Compiler Construction Pat Morin School of Computer Science.
Chapter 1. Introduction.
Advanced Computer Systems
Component 1.6.
Compiler Design (40-414) Main Text Book:
Chapter 1 Introduction.
SYSTEM SOFTWARE & COMPILER DESIGN
Computational Thinking, Problem-solving and Programming: General Principals IB Computer Science.
CSCI-235 Micro-Computer Applications
Lecture 1: Introduction to JAVA
System Programming and administration
CS101 Introduction to Computing Lecture 19 Programming Languages
Chapter 1 Introduction.
课程名 编译原理 Compiling Techniques
History of compiler development
CISC 7120X Programming Languages and Compilers
Compiler Lecture 1 CS510.
Introduction CSE 1310 – Introduction to Computers and Programming
Overview of the Course Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University.
Introduction to Compiler Construction
Course supervisor: Lubna Siddiqui
Lecture 2: General Structure of a Compiler
Compiler Construction
COMP Compilers Lecture 1: Introduction
Overview of the Course Copyright 2003, Keith D. Cooper, Ken Kennedy & Linda Torczon, all rights reserved. Students enrolled in Comp 412 at Rice University.
Compiler Structures 0. Preliminaries
Introduction to Compiler Construction
CISC 7120X Programming Languages and Compilers
Compilers Principles, Techniques, & Tools Taught by Jing Zhang
Compiler Construction
Programming language translators
Introduction to Compiler Construction
Compiler Construction CS 606 Sohail Aslam Lecture 1.
Presentation transcript:

COMP36512 - Compilers Lecture 1: Introduction Module Aims: Any program written in a programming language must be translated before it can be executed. This translation is typically accomplished by a software system called compiler. This module aims to introduce students to the principles and techniques used to perform this translation and the issues that arise in the construction of a compiler. 13-Apr-18 COMP36512 Lecture 1

COMP36512 - Compilers (cont.) Learning Outcomes: A student successfully completing this module should be able to: understand the principles governing all phases of the compilation process. understand the role of each of the basic components of a standard compiler. show awareness of the problems of and methods and techniques applied to each phase of the compilation process. apply standard techniques to solve basic problems that arise in compiler construction. understand how the compiler can take advantage of particular processor characteristics to generate good code. 13-Apr-18 COMP36512 Lecture 1

Course Lecturer - and Lectures Who am I? Rizos Sakellariou – rizos@manchester.ac.uk Research: Parallel and Distributed Systems (including scheduling, performance optimisation, etc), and (in the distant past) parallelising compilers Lectures: Tuesdays 11:00-13:00 (Chemistry G.54) handouts (and other information) available from: http://studentnet.cs.manchester.ac.uk/ugt/COMP36512/ How to study: Make Your Own Notes, and/or listen, understand, jot down, ask, interrupt, ... Study the book(s), …, …, … Flexible Approach/Engineering: tradeoff/constraints/optimization Assessment: 2-hour exam (3 questions out of 5) 13-Apr-18 COMP36512 Lecture 1

Course Texts Aho, Lam, Sethi, Ullman. “Compilers: Principles, Techniques and Tools”, 2nd edition. (Aho2) The 1st edition (by Aho, Sethi, Ullman – Aho1), the “Dragon Book”, has been a classic for over 20 years. Cooper & Torczon. “Engineering a Compiler” – an earlier draft has been consulted when preparing this module. The 2nd edition is now available and being assessed (pointers will be provided to the 1st and hopefully to the 2nd edition). Other books: Hunter et al. “The essence of Compilers” (Prentice-Hall) Grune et al. “Modern Compiler Design” (Wiley)

Syllabus 2 Introduction 3 Lexical Analysis (scanning) 1 – Exercises (on your own – optional) 3 Syntax Analysis (parsing) 1 Semantic Analysis 1 Intermediate Representations 1 Storage Management 1 Exercises (on your own – optional) 4 Code Generation 1 Code Optimisation 1 – Guest Lecture??? 2 Exam preparation - Conclusion

Definitions (compile: collect material into a list, volume) What is a compiler? A program that accepts as input a program text in a certain language and produces as output a program text in another language, while preserving the meaning of that text (Grune et al, 2000). A program that reads a program written in one language (source language) and translates it into an equivalent program in another language (target language) (Aho et al) What is an interpreter? A program that reads a source program and produces the results of executing this source. We deal with compilers! Many of these issues arise with interpreters! 13-Apr-18 COMP36512 Lecture 1

Examples C is typically compiled Lisp is typically interpreted Source program Examples compiler C is typically compiled Lisp is typically interpreted Java is compiled to bytecodes, which are then interpreted Also: C++ to Intel Core 2/.../Assembly C++ to C High Performance Fortran (HPF) to Fortran (parallelising compiler) C to C (or any language to itself) In the general sense: What is LaTeX? What is ghostview? (PostScript is a language for describing images) Target program 13-Apr-18 COMP36512 Lecture 1

Qualities of a Good Compiler What qualities would you want in a compiler? generates correct code (first and foremost!) generates fast code conforms to the specifications of the input language copes with essentially arbitrary input size, variables, etc. compilation time (linearly)proportional to size of source good diagnostics consistent optimisations works well with the debugger 13-Apr-18 COMP36512 Lecture 1

Principles of Compilation The compiler must: preserve the meaning of the program being compiled. “improve” the source code in some way. Other issues (depending on the setting): Speed (of compiled code) Space (size of compiled code) Feedback (information provided to the user) Debugging (transformations obscure the relationship source code vs target) Compilation time efficiency (fast or slow compiler?) 13-Apr-18 COMP36512 Lecture 1

Why study Compilation Technology? Success stories (one of the earliest branches in CS) Applying theory to practice (scanning, parsing, static analysis) Many practical applications have embedded languages (eg, tags) Practical algorithmic & engineering issues: Approximating really hard (and interesting!) problems Emphasis on efficiency and scalability Small issues can be important! Ideas from different parts of computer science are involved: AI: Heuristic search techniques; greedy algorithms - Algorithms: graph algorithms - Theory: pattern matching - Also: Systems, Architecture Compiler construction can be challenging and fun: new architectures always create new challenges; success requires mastery of complex interactions; results are useful; opportunity to achieve performance. 13-Apr-18 COMP36512 Lecture 1

Uses of Compiler Technology Most common use: translate a high-level program to object code Program Translation: binary translation, hardware synthesis, … Optimizations for computer architectures: Improve program performance, take into account hardware parallelism, etc… Automatic parallelisation or vectorisation Performance instrumentation: e.g., -pg option of cc or gcc Interpreters: e.g., Python, Ruby, Perl, Matlab, sh, … Software productivity tools Debugging aids: e.g, purify Security: Java VM uses compiler analysis to prove “safety” of Java code. Text formatters, just-in-time compilation for Java, power management, global distributed computing, … Key: Ability to extract properties of a source program (analysis) and transform it to construct a target program (synthesis) 13-Apr-18 COMP36512 Lecture 1

Summary A compiler is a program that converts some input text in a source language to output in a target language. Compiler construction poses some of the most challenging problems in computer science. Reading: Aho2, 1.1, 1.5; Aho1 1.1; Cooper1 1.1-1.3; Grune 1.1, 1.5 Next lecture: structure of a typical compiler. 13-Apr-18 COMP36512 Lecture 1