Compiler 2018
外观
Overview
- Source Language: Mx*
- Target Language: x86-64 Assembly in NASM format
- Compiler Language: Java (recommended), or any others, e.g. C, C++, Haskell, ...
- All lexer and parser generators are allowed, e.g. Antlr 4 (recommended), flex + bison, ...
- You need to write all other components by yourselves, including semantic analysis, code generation and optimization.
- Online Judge: Compiler 2018
- Any questions & discussions please go to Github Issue
Grading
- Objective Score: 100 pts
- Score Insurance: 85 pts
- Ladder Tournament: 15 pts
- Subjective Score: -5 ~ +5 pts
- Extra Bonus
Score Insurance
- Open testcases made by TAs
- Loose compile & run time limit (TBD)
- Late Policy: 1pt / day
Ladder Tournament
- Every student must contribute at least a testcase
- Compile & run time are limitted to 5 sec.
- total_score(student) = sum(score(student, testcase) for testcase in testcases)
- score(student, testcase) is calcuated by the rank of student's run time on this testcase
Schedule
Resources
Course
- 文件:M language manual.pdf (Update: April, 2017)
- Lequn Chen's slides 文件:Compiler2018 big picture.pdf (Update: March, 2018)
Java
- Core Java: Volume I - Fundamentals (10th Edition): douban, pirated pdf
Parsing
- The Definitive ANTLR 4 Reference: douban, pirated pdf
- Parsing Techniques: A Practical Guide (2nd Edition): douban, pirated pdf
- Compilers - Principles, Techniques, and Tools (2nd Edition): douban, pirated pdf
CodeGen & Optim
- Engineering a Compiler (2nd Edition): douban, pirated pdf
- Static Single Assignment Book: pdf
x86-64 & Assembly & Linux
- NASM Tutorial
- c2nasm.bash
- Linux System Call Table for x86-64
- x86 Assembly
- Stack frame layout on x86-64
- System V AMD64 ABI (x86-64 calling conventions)
- NASM Manual
- x64 Cheat Sheet (in GNU Assembler format)
- x86_64 NASM Assembly Quick Reference
- X86-64 Opcode and Instruction Reference
Books
- ふつうのコンパイラをつくろう: douban, pirated pdf
- Modern Compiler Implementation in Java (2nd Edition): douban, pirated pdf
- Crafting a Compiler (1st Edition): douban, pirated pdf
- Programming Language Pragmatics (3rd Edition): douban, pirated pdf
Some Links
Tutors
Name | |
---|---|
马融 | marong1024 [at] gmail.com |
郑怜悯 | mercy_zheng [at] sjtu.edu.cn |
陈欣昊 | chenxinhao [at] sjtu.edu.cn |
卢思迪 | desire2020 [at] sjtu.edu.cn |
盛佩瑶 | simplespy [at] sjtu.edu.cn |