Course Overview
Lecture 1
Table of Contents
Overview
Welcome to Compiler Construction!
What do you want to get out of this course?
- Intros
- Why are you taking this course?
- What do you hope to learn?
- about me, research, positions
- favorite course
- program analysis and transformation, tool engineers
- use course project to gauge interest
What I hope you will get out of thi
- Some discrete math background (formal prereq)
- Good programming
- Command-line competence
- Can install software on your own
Syllabus
http://www.cs.ucf.edu/~gazzillo/teaching/cop5621spring23/
- go over syllabus
- topics, course structure
- focusing a lot of front-end, higher-level language constructs, transformation, and analysis
- class structure
- webcourses
- slack
- attendance, quizzes (one question, we go over same day)
- homeworks (short, not graded strictly, just to keep up with course)
- compilers project, design together in class, implement on your own
- personal project, pick own project, implementation and present on your own
- readings, summaries for homework
- tentative list of papers
- if you have topics of interest now or during semester let me know
- topics, course structure
Special topics
- Technical content of some of my research
- Guest lecture from a PhD student doing research
- What would you like to see?
- Functional languages?
- Program analysis?
- Transformation?
- Code generation?
- Optimization?
- Compiler back-end
Course software
- Linux OS
- Installing VM software
vagrant init ubuntu/hirsute64
vagrant up
- Installing VM software
- git, make, java
- apt install git openjdk-11-jdk-headless build-essential
- openjdk-11-jdk if you want ANTLR GUI
- git and command-line tutorial
- apt install git openjdk-11-jdk-headless build-essential
- ANTLR parser framework
- apt install antlr4
- (I'll also provide the ANTLR lib with the projects)
Compiler Intro
What is a compiler?
What makes compiler-writing hard?
- Three different programs
- Input program
- Ouput program
- The compiler itself
Compiler vs. interpreter
Interpreter
Compiler
Interpreter (with source)
Compiler (with source)
Compiler phases
- Front-end
- "Middle-end"
- Back-end
- LLVM Compiler Infrastructure
Front-end
- Language-processing
- Remember regexes, grammar from discrete? (If you took it)
- Type checking
- Did I assign an array to a float?
Back-end
- Code generation
- Equivalent machine code for any valid input program
- Optimization
- Choose equivalent machine code that's faster, smaller, etc.
"Middle-end"
- Intermediate code
- Like machine code
- Without machine specifics
- Lots of different designs
Symbols vs. meaning
1 + 2 * 3
6 / 2(1 + 2)
一加二乘三
What gives symbols meaning?
- Moon vs. finger pointing at the moon
- "The map is not the territory"
- the compiler itself defines meaning
- defines input language in terms of output language
- (why does output language have meaning?)
ASCII vs. machine code
od
gcc -S
- ASCII table
Homework
- Join slack (see webcourses)
- Setup your git repo (see webcourses)
- Submit the webcourses assignment where you submit your class project repo
- Setup your environment (vagrant as needed, java, git, etc.)