start
This is an old revision of the document!
Table of Contents
News
- May 1 — The final code review is fixed at Wednesday May 9.
- Apr 12 — Add references and codes for code generation
- Apr 1 — Add SPIM reference
- Mar 28 — Add QuadPackage Quad for intermediate representation and slide for phase3 .
- Mar 26 — Add midterm submission specification
- Mar 15 — TAs have finished the compiler.
- Mar 13 — Add compilation model.
- Mar 4 — Checkout our test-case repository:
git clone git@giti.me:compiler-testcases.git
(it's public). - Mar 1 — Add resources for phase 1; update schedule; update overall page structure.
- Feb 21 — Clean up homepage.
- Feb 16 — Hello world!
Introduction
Welcome to CS216, Project Workshop of Compiler Principals! In this course, you will implement a compiler for a simplified version of Java from scratch, and by yourself.
Schedule
- Feb 29, 8:30pm: Course overview; syntactic analysis
- Mar 14, 8:30pm: Semantic analysis
- Mar 27: Mid-term submission (30% score)
- Mar 28, 8:30pm: Intermediate representation; code review of phase 1,2
- Apr 11, 8:30pm: Code generation; additional code review
- Apr 25, 7:30pm: Register allocation
- May ? — May 15: Test stage (70% score, test everyday); see final submission specification
- May 9: Final code review (including phase 3,4,5)
- May 16: Bonus code review (optimization, garbage collection, etc.)
- May 16: Report submission deadline
Phase 1: Syntactic Analysis
- Compiler framework (you may start with it or write your own)
Phase 2: Semantic Analysis
Phase 3: Intermediate Representation
Phase 4: Code Generation
- A sample runtime library that is not worth referencing
Phase 5: Register Allocation
提倡使用Linear Scan代替传统图染色
Linear Scan
Grading
- Correctness
- Code reviews
Bonus
任务0: 使用git管理代码
- 任务描述与参与方法
- 使用giti.me服务管理本次大作业的代码
- 只使用git上传测试使用的jar文件不算
- 奖励
- 使用良好者最终成绩+1分,如果总分超过满分则只记满分
- 截止日期
- 2012年5月1日
任务1: Name Our New Language (1)
- 任务描述
- 取名最好和java类似,如lava,sava等
- 如果能带点hacker风格的recursive acronym更好,参考http://en.wikipedia.org/wiki/Recursive_acronym
- 参与方法
- 在google group对应的帖子中说明自己的想法
- 奖励
- 建议被采纳的同学最终成绩+1分,如果总分超过满分则只记满分
- 本奖励可能落空
- 截止日期
- 2012年5月15日,如果理想名字提前产生,活动将提前截止
任务2: Visitor Pattern (3)
- 任务描述
- 以文档的方式阐述以下问题:
- 解释什么是 Visitor Pattern,及几种实现方法,参考[1][2]
- 比较[3][4]中的Semantic Analysis模块是怎么设计的,有哪些要件,这些要件是如何协作的,顺序和流程为何?
- 如何在我们的编译器中使用Visitor Pattern?会出现什么问题?如何解决? -
- 制作成pdf版本或方便阅读的文档(比如写在自己的blog上),必要以具体的code说明,中英文均可
- 参与方法
- 在google group对应的帖子中公布自己的解答
- 奖励
- 文档被采纳的同学最终成绩+3分,如果总分超过满分则只记满分
- 可能有多人同时获得加分(1-3分不等)
- 只要有人参与,保证本奖励不会落空
- 截止日期
- 2012年5月15日,如果提前得到理想解答,截止日期也会提前
- 参考文献
- [1] Gamma, Helm, Johnson & Vlissides. Design Patterns (the Gang of Four book).
- [2] J Palsberg. The Essence of the Visitor Pattern
- [3] Andrew W. Appel. Modern Compiler Implementation in Java
- [4] Andrew W. Appel. Modern Compiler Implementation in Java (2nd Edition)
任务3: 武松打虎 (1-3)
- 任务描述
- 用新语言设计一个Killer程序,文本大小不超过1M,使得所有编译器的编译时间尽量长,或者崩溃
- 设计者的Killer程序必须符合语法,且必须有明确的判定运行结果是否正确的方法
- 设计者的编译器必须能编译自己的Killer程序,编译时间必须合理(1分钟,1小时或者24小时)
- 设计者的编译出的关于Killer程序的目标代码在spim中的执行结果必须正确,运行时间必须合理(1分钟,1小时或者24小时)
- 要求提供构造的思路和说明
- 参与方法
- 将编写的killer文件提交给助教
- 奖励
- 除自己的编译器之外,其他编译器编译的最短时间最长的为获胜者,崩溃的编译器的编译时间算作无穷大。
- 前三名分别得到3,2,1分,如果个别程序有新意,就算不在前三名内,也可能授予1-3分的奖励
- 截止日期
- 期末测试开始之前
任务4: Test Cases (1-2)
- 任务描述
- 出第一轮测试的数据
- 要求在源文件中添加详细的说明,并附上自己的名字
- 参与方法
- 将自己写的testcase打包发到group中,确保没有重复并通过助教审核
- 奖励
- 每5个测试数据1分,2分封顶
- 没有合作
- 截止日期
- 2012年3月23日(含)
任务5: Test Cases (Final)
- 任务描述
- 将以前Tiger的测试数据(在compiler-testcases这个repository里)转换到新语言,作为期末测试的数据
- 要求在源文件中添加详细的说明,并附上自己的名字;原数据有作者信息的,要一并保留
- 转换后的程序,正确运行的结果应与ANSWERS文件里的相应内容一致
- 参与方法
- 将测试数据打包发到group中,确保没有重复并通过助教审核
- 奖励
- 每5个测试数据1分,3分封顶
- 没有合作
- 截止日期
- 2012年5月2日(含)
Links
Contacts
- Menghui Wang (王孟晖) —
wmhkebe [at] gmail.com
- Ruixin Qiang (强瑞鑫) —
ghost.gold [at] gmail.com
- Shijian Li (李诗剑) —
95588lsj [at] gmail.com
- Xiao Jia (贾枭) —
xjia [at] cs.sjtu.edu.cn
- Rong Ma (马融) —
marong1204 [at] gmail.com
start.1336012325.txt.gz · Last modified: 2012/05/03 02:32 by xjia