ID2202 Compilers and Execution Environments 7.5 credits
Kompilatorer och exekveringsmiljöer
The course covers techniques for the implementation of programming languages using compilers in both real and virtual execution environments.
The overall aim of the course is to provide an understanding of how a programming language is implemented including common theories and how these theories are applied. The course will cover techniques for reading, understanding, translating, improving, and executing programs.
Educational level
Second cycleAcademic level (A-D)
CSubject area
Grade scale
A, B, C, D, E, FX, F
Course offerings
Autumn 12 for programme students
Periods
Autumn 12 P2 (7.5 credits)
Application code
50383Start date
2012 week: 43End date
2013 week: 1Language of instruction
EnglishCampus
KTH KistaNumber of lectures
Number of exercises
Tutoring time
DaytimeForm of study
NormalNumber of places
No limitationSchedule
Schedule (new window)Course responsible
Christian Schulte <cschulte@kth.se>
Teacher
Christian Schulte <cschulte@kth.se>
Target group
Open to all programs
Part of programme
- Bachelor's Programme in Information and Communication Technology, year 3, Optional
- Degree Progr. in Computer Engineering, year 3, DPUB, Conditionally Elective
- Degree Progr. in Information and Communication Technology, year 3, Conditionally Elective
- Master (Two Years), Computer Science, year 1, CSCH, Conditionally Elective
- Master (Two Years), Computer Science, year 2, CSCH, Conditionally Elective
- Master (Two Years), ICT Innovation, year 1, INSY, Mandatory
- Master (Two Years), System-on-Chip Design, year 2, Conditionally Elective
- Master's Program, Embedded Systems, year 1, Mandatory
- Master's Program, Embedded Systems, year 2, Conditionally Elective
Autumn 13 for programme students
Periods
Autumn 13 P2 (7.5 credits)
Application code
50193Start date
2013 week: 45End date
2014 week: 3Language of instruction
EnglishCampus
KTH KistaNumber of lectures
Number of exercises
Tutoring time
DaytimeForm of study
NormalNumber of places *
Min. 25*) The Course date may be cancelled if number of admitted are less than minimum of places.
Schedule
Schedule (new window)Course responsible
Christian Schulte <cschulte@kth.se>
Teacher
Christian Schulte <cschulte@kth.se>
Target group
Open to all programs
Part of programme
- Bachelor's Programme in Information and Communication Technology, year 3, Optional
- Degree Progr. in Computer Engineering, year 3, DPUB, Conditionally Elective
- Degree Progr. in Information and Communication Technology, year 3, Conditionally Elective
- Master (Two Years), Computer Science, year 1, CSCH, Conditionally Elective
- Master (Two Years), Computer Science, year 2, CSCH, Conditionally Elective
- Master (Two Years), ICT Innovation, year 1, INSY, Mandatory
- Master (Two Years), System-on-Chip Design, year 2, Conditionally Elective
- Master's Program, Embedded Systems, year 1, Mandatory
- Master's Program, Embedded Systems, year 2, Conditionally Elective
Learning outcomes
The course covers techniques for the implementation of programming languages using compilers in both real and virtual execution environments.
The overall aim of the course is to provide an understanding of how a programming language is implemented including common theories and how these theories are applied. The course will cover techniques for reading, understanding, translating, improving, and executing programs.
This understanding means that after the course a student should be able to:
explain the overall structure of a compiler.
describe regular expressions and finite automata and use them unambiguously for lexical analysis;
combine and apply techniques to construct a deterministic finite automaton from regular expressions.
describe context free grammars and apply them to capture common programming language constructs; describe the basic approach of top-down and bottom-up parsing;
construct recursive descent, LL(1), LR(0), and SLR parsers;
identify whether grammars can be used with a given parsing technique.
list and describe tasks carried out during semantic analysis.
describe the design principles behind intermediate program representations;
explain and apply methods for selecting instructions;
describe the organization of activation records and identify the impact of different design decisions for activation records on program execution.
define the liveness of variables and compute liveness information from control flow graphs;
define the principles of conservative approximations for analyzing programs;
construct interference graphs and perform complete register allocation on them reflecting the design of activation records.
name key components in an execution environment;
describe simple techniques for heap management and garbage collection;
identify the amortized costs of different approaches to garbage collection;
list common techniques and explain their properties used in virtual execution environments.
describe common techniques for program optimization;
identify loops in programs using dominators;
describe and apply techniques for optimizing loops and memory access.
describe how characteristics of hardware architectures influence compilation of programs;
give examples of important characteristics.
Course main content
Reading programs: lexical and syntactic analysis. Finite automata, regular expressions, LL- and LR-parsing.
Understanding programs: Semantic analysis, type checking. Scope control, declarations and expressions.
Translating programs: machines and instructions. Intermediate code, instruction selection, stacks and procedure calls.
Executing programs: virtual execution environments and run-time systems. Memory management, garbage collection, loading and linking, just-in-time compilation.
Dependencies on hardware architecture.
Improving programs: optimization. Machine independent optimizations (dataflow analysis, strength reduction, ...)
Machine level optimization (register allocation, scheduling, prefetching, power consumption...)
Eligibility
120 university credits (hp) in engineering or natural sciences and documented proficiency in English corresponding to English A.
and
Courses in basic computer organization/architecture, Programming in C or Java, algorithms and data structures. Basic knowledge of C-programming.
Prerequisites
IS1200 Computer Hardware Basics,
ID1218 Applied Programming or equivalent.
Literature
Modern Compiler Implementation in Java, Andrew W. Appel
Upplaga: Second Förlag: Cambridge University Press År: 2002
ISBN:
Examination
- INL1 - Assignments, 1.5 credits, grade scale: P, F
- TEN1 - Examination, 6.0 credits, grade scale: A, B, C, D, E, FX, F
Requirements for final grade
Approved written exam (TEN1; 6hp) and approved home assignments (INL1; 1.5hp).
The home assignments are evaluated with the grades P/F (pass or fail). The course features three assignments which must be solved and submitted in time (you will have one week to solve all tasks on
an assignment). Each assignment will feature 6 points on tasks. In order to pass the assignment part of the course you have to reach 9 points on all three assignments.
If you submit an assignment in time, the points will serve as bonus points on the exam. That means that you can score at most 18 bonus points for the exam. Note: the bonus points are valid only for this academic year.
The tasks of the exam are worth 200 points.
The grades for the entire course are defined by total points being the sum of the exam points and the bonus points you got on the assignments. You need at least 100 total points to pass the exam.
The written exam is evaluated with the grades A-F.
The grades for the number of total points n are as follows:
n >= 180: A
180 > n >= 160: B
160 > n >= 140: C
140 > n >= 120: D
120 > n >= 100: E
100 > n >= 80: Fx
80 > n : F
In case of the grade Fx, completing examination is possible within one month after the original exam. In that case, the course responsible will on demand offer an extra home assignment to be solved by the student within one week.
Offered by
ICT/Software and Computer system
Contact
Schulte, Christian
Examiner
Christian Schulte <cschulte@kth.se>
Version
Course plan valid from:
Autumn 10.
Examination information valid from:
Autumn 07.
