lecture 0 course overview - korea...

12
COSE312: Compilers Lecture 0 — Course Overview Hakjoo Oh 2017 Spring Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 1 / 11

Upload: others

Post on 02-Oct-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 0 Course Overview - Korea Universityprl.korea.ac.kr/~pronto/home/courses/cose312/2017/slides/lec0.pdf3 Lexical Analysis 4 Syntax Analysis 5 Syntax Analysis 6 Syntax Analysis

COSE312: Compilers

Lecture 0 — Course Overview

Hakjoo Oh2017 Spring

Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 1 / 11

Page 2: Lecture 0 Course Overview - Korea Universityprl.korea.ac.kr/~pronto/home/courses/cose312/2017/slides/lec0.pdf3 Lexical Analysis 4 Syntax Analysis 5 Syntax Analysis 6 Syntax Analysis

Basic Information

Instructor: Hakjoo Oh

Position: Assistant professor in Computer Science and Engineering,Korea University

Expertise: Programming Languages

Office: 616c, Science Library

Email: [email protected]

Office Hours: 1:00pm–3:00pm Mondays and Wednesdays (byappointment)

TA:

Sunbeom So ([email protected])

Myungho Lee ([email protected])

Course Website:

http://prl.korea.ac.kr/~hakjoo/courses/cose312/2017/

Course materials will be available here.

Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 2 / 11

Page 3: Lecture 0 Course Overview - Korea Universityprl.korea.ac.kr/~pronto/home/courses/cose312/2017/slides/lec0.pdf3 Lexical Analysis 4 Syntax Analysis 5 Syntax Analysis 6 Syntax Analysis

What is Compiler?

A compiler is a software system that translates programs written in ahigh-level programming language into a low-level machine language.

Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 3 / 11

Page 4: Lecture 0 Course Overview - Korea Universityprl.korea.ac.kr/~pronto/home/courses/cose312/2017/slides/lec0.pdf3 Lexical Analysis 4 Syntax Analysis 5 Syntax Analysis 6 Syntax Analysis

What is Compiler?

A compiler is a software system that translates programs written in ahigh-level programming language into a low-level machine language.

Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 3 / 11

Page 5: Lecture 0 Course Overview - Korea Universityprl.korea.ac.kr/~pronto/home/courses/cose312/2017/slides/lec0.pdf3 Lexical Analysis 4 Syntax Analysis 5 Syntax Analysis 6 Syntax Analysis

Why bother to take a compiler course?

Compilers are one of the most important software systems.

To deeply understand computer science in general.I computation theory (automata, grammars), algorithms

(greedy/dynamic programming), fixed point theory (data-flowanalysis), software engineering, etc.

A good application of theory to practical problems.

Writing a compiler is a substantial programming experience.

Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 4 / 11

Page 6: Lecture 0 Course Overview - Korea Universityprl.korea.ac.kr/~pronto/home/courses/cose312/2017/slides/lec0.pdf3 Lexical Analysis 4 Syntax Analysis 5 Syntax Analysis 6 Syntax Analysis

Course Overview

You will learn principles and techniques for compiler construction.

Lexical analysis: lexical tokens, regular expressions, finite automata,lexical analyzer generators

Syntax analysis: context-free grammars, top-down parsing,bottom-up parsing, parser generators

Semantic analysis: optimization, verification, data-flow analysis,static analysis

Translation: syntax-directed translation, three address code, controlflow graph, basic blocks

Code generation (optional): register allocation and assignments,instruction selection, machine code generation

Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 5 / 11

Page 7: Lecture 0 Course Overview - Korea Universityprl.korea.ac.kr/~pronto/home/courses/cose312/2017/slides/lec0.pdf3 Lexical Analysis 4 Syntax Analysis 5 Syntax Analysis 6 Syntax Analysis

References

Self-contained slides will be provided.

Compilers: Principles, Techniques, and Tools (Second Edition) byAho, Lam, Sethi, and Ullman. MIT Press.

Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 6 / 11

Page 8: Lecture 0 Course Overview - Korea Universityprl.korea.ac.kr/~pronto/home/courses/cose312/2017/slides/lec0.pdf3 Lexical Analysis 4 Syntax Analysis 5 Syntax Analysis 6 Syntax Analysis

Prerequisites

Extensive programming experiences

Major CS courses: discrete maths, data structures, algorithms,programming languages, theory of computation, architecture, etc

Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 7 / 11

Page 9: Lecture 0 Course Overview - Korea Universityprl.korea.ac.kr/~pronto/home/courses/cose312/2017/slides/lec0.pdf3 Lexical Analysis 4 Syntax Analysis 5 Syntax Analysis 6 Syntax Analysis

Grading

Programming assignments – 30%

Midterm exam – 30%

Final exam – 30%

Attendance and participation – 10%

Assignment policy:

No late submissions will be accepted.

All assignments must be your own work.I Copying gets you 0 for the entire HW score. We use software for

detecting code clones.

Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 8 / 11

Page 10: Lecture 0 Course Overview - Korea Universityprl.korea.ac.kr/~pronto/home/courses/cose312/2017/slides/lec0.pdf3 Lexical Analysis 4 Syntax Analysis 5 Syntax Analysis 6 Syntax Analysis

Programming Assignments in ML

ML is a family of programming languages including SML, OCaml, F#, etc.

Support higher-order, strict, mostly pure, and typed, with algebraicdata types.

Inspired the design of many modern programming languages.

Suitable for implementing language processors.

A good deal of syntax.

We will use OCaml:

Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 9 / 11

Page 11: Lecture 0 Course Overview - Korea Universityprl.korea.ac.kr/~pronto/home/courses/cose312/2017/slides/lec0.pdf3 Lexical Analysis 4 Syntax Analysis 5 Syntax Analysis 6 Syntax Analysis

Schedule (tentative)

Weeks Topics

1 Introduction2 Lexical Analysis3 Lexical Analysis4 Syntax Analysis5 Syntax Analysis6 Syntax Analysis7 Syntax Analysis8 Intermediate Representation9 Mid-term exam10 Intermediate Representation11 Code Optimization12 Code Optimization13 Program Analysis14 Program Analysis15 Code Generation (optional)16 Final exam

Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 10 / 11

Page 12: Lecture 0 Course Overview - Korea Universityprl.korea.ac.kr/~pronto/home/courses/cose312/2017/slides/lec0.pdf3 Lexical Analysis 4 Syntax Analysis 5 Syntax Analysis 6 Syntax Analysis

Today: Icebreaking

Introduce yourself (< 1min):

Free format. Say anything.

Nothing to talk about? major, grade, interests, hobbies, specialty,goal, motivation for this course, what you expect from this course, etc

Hakjoo Oh COSE312 2017 Spring, Lecture 0 March 6, 2017 11 / 11