Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Motivation for doing this • XML, html based systems, Awk, Sed , Emacs , vi ….

course • Form processing, extracting information


• Language processing is an important component of automatically from forms
programming
• Compilers, assemblers and linkers
• A large number of systems software and application
Principles of Compiler Design programs require structured input
• High level language to language translators
• Operating Systems (command line processing)
• Natural language processing
Sanjeev K Aggarwal • Databases (Query language processing)

Department of Computer Science • Type setting systems like Latex, Nroff, Troff, Equation
• Where ever input has a structure one can think of
and Engineering, IIT Kanpur editors, M4 language processing
ska@iitk.ac.in • VLSI design and testing, • Why study compilers?
Compilers use the whole spectrum of language
• Software quality assurance and software testing processing technology
1 2 3

What will we learn in the course?


Many common applications require structured input
during development phase (design of banner
What do we expect to achieve
programme of Unix) • How high level languages are implemented to generate machine
code. Complete structure of compilers and how various parts are by the end of the course?
composed together to get a compiler
xxxxxxxxx 9x • Course has theoretical and practical components. Both are needed
• Students are confident that they can
xxxxxxxxx 9x in implementing programming languages. The focus will be on
practical application of the theory.
use language processing technology for
xxxxxxxxx 9x
xxx
various software developments
3b 3x • Emphasis will be on algorithms and data structures rather than
3 9x
xxx 3b 3x proofs of correctness of algorithms.
6 3b 3x
xxx 3b 3x
xxx 3 9x • Theory of lexical analysis, parsing, type checking, runtime syst em, • Students are confident that they can
3b 3x code generation, optimization (without going too deep into the
xxx 3b 3x
proofs etc.) design, develop, understand,
xxx 3b 3x • Techniques for developing lexical analyzers, parsers, type modify/enhance, and maintain compilers
xxxxxxxxx 9x
checkers, run time systems, code generator, optimization. Use of
tools and specifications for developing various parts of compilers for (even complex!) programming
xxxxxxxxx 9x languages
xxxxxxxxx 9x 4 5 6

1
Organization of the course Class Notes Required Background and self
• Approximately 40 lectures of one hour each reading
• One large programming project to be done in group of four students. • Groups of three students to be formed by the instructor in
The project will have 4-5 parts and will be evaluated every 2-3 weeks round robin fashion • This is a 5 unit course and, therefore, will have about 25%
during the semester. It is important to start early. (25% credit) more load than other professional courses. You should be
– Copying old code is cheating. Do not Cheat. prepared for more work and long hours of programming
• Each group will be responsible for preparing notes (both
– Late submissions will be increasingly penalized. writing and editing) for two consecutive lectures
– Submissions must happen by noon on the due day • Courses in data structures, computer organization, operating
systems
• Some small programming assignments and home work (10% credit) • Notes should be related to slides or a group of slides
– Do not copy. However, you are free to discuss • Proficiency in C/C++/Java programming languages
– Late submissions will be increasingly penalized. • Notes should be added to the power point slides of the
– Submissions must happen by noon on the due day lectures
• Knowledge of at least one assembly language, assembler,
• Two mid semester examinations (15% + 15% credit) linker & loader, symbolic debugger
• Slides and notes will be made available to the students
• One end semester examination (30% credit) • You are expected to read the complete book (except the
• Deadline for notes: Seven days from the second lecture chapter on code optimization) on Compiler Design by Aho,
• Participation in the discussions in the class + class notes (5% credit) Sethi and Ullman. All the material will not be covered in the
lectures
7 8 9

Things to do immediately Bit of History Some early machines and


• Form groups of 4 students • How are programming languages implemented? Two
major strategies: implementations
• Inform the instructor – Interpreters (old and much less studied) • IBM developed 704 in 1954. All programming was
– Send an email with subject line “CS335 group” – Compilers (very well understood with done in assembly language. Cost of software
– Give roll number, name and email ids of all the group development far exceeded cost of hardware. Low
mathematical foundations)
members in the message productivity.
– Deadline Dec 31, 2004
• Some environments provide both interpreter and • Speedcoding interpreter: programs ran about 10
• Give feed back through out the semester; either personally compiler. Lisp, scheme etc. provide
or through email or anonymous. times slower than hand written assembly code
PLEASE HELP ME IMPROVING THE SLIDES (both – Interpreter for development
presentation style and the material), AND THE NOTES!! – Compiler for deployment • John Backus (in 1954): Proposed a program that
translated high level expressions into native
• First assignment: Write a simulator for the stack machine machine code. Skeptism all around. Most people
described in the text book by Aho, Sethi and Ullman in • Java thought it was impossible
section 2.8. Submission date: Jan 10, 2005
– Java compiler: Java to interpretable bytecode
– Java JIT: bytecode to executable image • Fortran I project (1954-1957): The first compiler
10 11 was released 12

2
Fortran I References • Compiler Design by Wilhelm and Maurer

• The first compiler had a huge impact on the • Compilers: Principles, Tools and Techniques by Aho, Sethi • A Retargetable Compiler: Design and Implementation by Fraser and
programming languages and computer science. The and Ullman Hanson
whole new field of compiler design was started soon to be replaced by “21st Century Compilers” by Aho,
Sethi, Ullman, and Lam • Compiler Construction by Wirth

• More than half the programmers were using • Crafting a Compiler in C by Fischer and LeBlanc • The Theory of Parsing, Translation and Compiling (vol 1 & 2) by Aho and
Fortran by 1958 soon to be replaced by “Crafting a Compiler” by Fischer Ullman (old classic)

• Introduction to Compiler Construction with Unix by Schreiner and


• The development time was cut down to half • Compiler Design in C by Holub Friedman

• Programming Language Pragmatics by Scott • Compiler Design and Construction: Tools and Techniques by Pyster
• Led to enormous amount of theoretical work
(lexical analysis, parsing, optimization, structured • Engineering a Compiler by Anklam and Cutler
programming, code generation, error recovery • Engineering a Compiler by Cooper and Torczon
etc.) • Object Oriented Compiler Construction by Holmes
• Modern Compiler Implementation (in C and in Java) by Appel
• The Compiler Design Handbook edited by Srikant and Shankar
• Modern compilers preserve the basic structure of • Writing Compilers and Interpreters by Mak
the Fortran I compiler !!!
13 14 15

You might also like