Spring 2010 Lecture 1: IntroductionLecture 1: Introduction Intro. to Computer Language Engineering Course Administration infoCourse Administration info.OutlineOutline • Course Administration Information • Course Administration Information • Introduction to computer language engineering – Why do we need a compiler? – What are compilers? – Anatomy of a compiler Saman Amarasinghe 2 6.035 ©MIT Fall 1998•Course AdministrationCourse Administration • Staff• Staff • Optional Text • Course Outline • The Projectj• Project Groups • GradingGrading Saman Amarasinghe 3 6.035 ©MIT Fall 1998Reference TextbooksReference Textbooks • Modern Compiler Implementation in Java (Tiger book) A.W. Appel Cambridge University Press, 1998 A textbook tutorial on compiler implementation, including techniques for many language Cambridge University Press, 1998 ISBN 0-52158-388-8 • Advanced Compiler Design and Implementation (Whale book) Steven Muchnick techniques for many language features Essentially a recipe book of ti i ti l t d Steven Muchnick Morgan Kaufman Publishers, 1997 ISBN 1-55860-320-4 • Compilers: Principles Techniques and Tools (Dragon book) optimizations; very complete and suited for industrial practitioners and researchers. Th l i il t tb k • Compilers: Principles, Techniques and Tools (Dragon book) Aho, Lam, Sethi and Ullman Addison-Wesley, 2006 ISBN 0321486811 The classic compilers textbook, although its front-end emphasis reflects its age. New edition has more optimization material. • Engineering a Compiler (Ark book) Keith D. Cooper, Linda Torczon Morgan Kaufman Publishers, 2003 ISBN 1 55860 698 X A modern classroom textbook, with increased emphasis on the back-end and implementation techniques ISBN 1 -55860 -698 -X • Optimizing Compilers for Modern Architectures Randy Allen and Ken Kennedy techniques. A modern textbook that focuses on optimizations including Mor g an Kaufman Publishers, 2001 ISBN 1-55860-286-0 parallelization and memory hierarchy optimization Saman Amarasinghe 5 6.035 ©MIT Fall 1998The Project: The Five SegmentsThe Project: The Five Segments Lexical and Syntax Analysis Lexical and Syntax Analysis Semantic Analysis Code Generation Data-flow Analysis Data flow Analysis Optimizations Saman Amarasinghe 6 6.035 ©MIT Fall 1998Each Segment...Each Segment... • Segment Start – Project Description •Lectures – 2 to 5 lectures • Project Time – (Design Document)(Design Document) – (Project Checkpoint) • Project Due• Project Due Saman Amarasinghe 7 6.035 ©MIT Fall 1998t t tProject GroupsProject Groups • 1st project is an individual project 1 project is an individual project • Projects 2 to 5 are group projects consists of 3 to 4 students •Grading All b ( l ) h d– All group members (mostly) get the same grade Saman Amarasinghe 8 6.035 ©MIT Fall 1998GradesGrades • Compiler project 70%• Compiler project 70% • In-class Quizzes 30% (10% each) • In-class mini-quizzes 10% (0.5% each) Saman Amarasinghe 10 6.035 ©MIT Fall 1998Grades for the ProjectGrades for the Project – Scanner/Parser 5% S ti Ch ki 75% – Semantic Checking 7.5% – Code Generation 10% Dt fl A l i 75% – Data-flow Analysis 7.5% – Optimizations 30% 60% Saman Amarasinghe 11 6.035 ©MIT Fall 1998–•Optimization SegmentOptimization Segment • Makingprograms run fastMaking programs run fast – We provide a test set of applications – Figure-out what will make them run fast – Prioritize and implement the optimizationsPrioritize and implement the optimizations – Compiler derby at the end • A “similar” application to the test set is provided the day before • The compiler that produced the fastest code is the winnerThe compiler that produced the fastest code is the winner • Do any optimizations you choose – Including parallelization for multicores • Grade is divided into: –Documentation 6% • Justify your optimizations and the selection processyy p p – Optimization Implementation 12% • Producing correct code – Derby performance 12% Saman Amarasinghe 12 6.035 ©MIT Fall 1998 Derby performance 12% 30%The QuizThe Quiz • Three Quizzes • Three Quizzes • In-Class Quiz – 50 Minutes (be on time!) – Open book, open notes Saman Amarasinghe 13 6.035 ©MIT Fall 1998Mini QuizzesMini Quizzes • You already got one • You already got one. • Given at the beginning of the class; Collected at th dthe end • Collaboration is OK • This is in lieu of time consuming problem setsThis is in lieu of time consuming problem sets Saman Amarasinghe 14 6.035 ©MIT Fall 1998OutlineOutline • Course Administration Information • Course Administration Information • Introduction to computer language engineering – What are compilers? – Why should we learn about them? – Anatomy of a compiler Saman Amarasinghe 15 6.035 ©MIT Fall 1998–Why Study Compilers?Why Study Compilers? • Compilers enable programming at a high level • Compilers enable programming at a high level language instead of machine instructions. Malleability Portability Modularity Simplicity – Malleability, Portability, Modularity, Simplicity, Programmer Productivity – Also Efficiency and PerformanceAlso Efficiency and Performance Saman Amarasinghe 16 6.035 ©MIT Fall 1998t t t t•Compilers Construction touches t i i C t S imany topics in Computer Science • Theory Fi it St A G d P i d fl– Finite State Automata, Grammars and Parsing, data-flow • Algorithms – Graph manipulation, dynamic programming • Data structures – Symbol tables, abstract syntax trees • SystemsSystems – Allocation and naming, multi-pass systems, compiler construction • Computer Architecture M hi h i t ti l ti i t l k d lt i llli – Memory hierarchy, instruction selection, interlocks and latencies, parallelism •Security – Detection of and Protection against vulnerabilities • Software Engineering – Software development environments, debugging • Artificial Intelligence Saman Amarasinghe 17 6.035 ©MIT Fall 1998 Artificial Intelligence – Heuristic based search for best optimizationsPower of a LanguagePower of a Language • Can use to describe any action • Can use to describe any action – Not tied to a “context” M t d ib th ti • Many ways to describe the same action –Flexible Saman Amarasinghe 18 6.035
View Full Document