MyOOPS開放式課程
請加入會員以使用更多個人化功能
來自全球頂尖大學的開放式課程,現在由世界各國的數千名義工志工為您翻譯成中文。請免費享用!
課程來源:MIT
     

6.035 電腦語言工程(SMA 5502),2005秋季課程

6.035 Computer Language Engineering (SMA 5502), Fall 2005

 

譯者:張海旻

編輯:陳盈、洪曉慧

Image of a computer screen.

電腦螢幕。(Photo © openphoto.net.)

 

課程重點

 

本課程的課堂講稿部份包含所有的課堂講稿以及其中的部分影片。專題部分包含獨立的專題作業。此外,測驗部分包含實際的練習。

 

課程描述

 

6.035是一門電腦系統與結構的主要課程。本課程對高級程式設計語言的實務作業進行了分析。主題涵蓋了:編譯器的基礎概念、功能與結構,基本的程式優化技術,理論與實踐的交互作用以及使用工具來建構軟體。本課程側重於一個多人進行專題,是以JAVA®編寫並並產生MIPS可執行機器碼之編譯器設計與實務執行。這門課程擁有8個工程設計學分。

 

這門課程同時也作為新加坡-麻省理工學院聯合專案Singapore-MIT AllianceSMA)之部分教學,其課程號為SMA 5502(電腦語言工程)。

 

技術需求

需要特定軟體來使用課程中的部分檔案:.rm, .mp3.

 

教學大綱

必備先修課程和條件

 

6.170並且精通JAVA®

 

課程模式

 

6.035的講座、問題集和考試圍依編譯器專題而構建,這一專題被分為五個階段。每階段建構編譯器的一個獨立部分。每階段(除第一階段)包含一系列的講座、一個程式設計作業以及一份問題集或一場隨堂測試。

 

一個階段剛開始時將提供程式設計作業。之後會有一系列講座來介紹內容。該階段的剩餘時間將被用於專題,因此將不再上課。每個組應當與你們的助教安排一個專題回顧周會來討論設計決定、專題進程和小組狀態。一個階段在專題作業的截止日期結束。這份時程表略述了進度,報告4“專題回顧在專題細節上有所延伸。除了專題,還將有三場隨堂測試和四次論文作業,其中包括一次和教員一對一的論文討論。

 

關於專題

 

6.035的主要課程工作是設計並完成一個編譯器。在課程的每階段將建構編譯器的一部分。這五部分分別是掃描器和解析器、語義檢查器、代碼生成器、資料流程優化器和指令優化器。所有五次作業都是小組專題。

 

前幾年裏我們提供這一編譯器專題的兩個版本,一個18單元的版本和一個12單元的版本。所有專題組成員應當註冊具有相同單元數的版本。所有學生應當註冊6.03512單元)。想挑戰高難度專題的學生可以在附加日期註冊6.9076單元)。在6.907的附表中不需要有教授的簽名。額外6個單元的分數只以專題為基準。

 

12單元版本的專題是出於健康考慮:你將在只有無咖啡因咖啡(毫無幫助)的情況下得到一次實作建構一個簡單而完整的編譯器的經歷。在18單元版本的專題中,你將被提供一杯香濃、熱氣騰騰的濃縮咖啡來使你經歷一些在真實世界中建構適用於工業級的編譯器時所遇到的問題。

 

我們為有興趣的學生提供更有難度的專題和六個額外的單元以使其能有機會對在建構編譯器時所涉及的論題有更深入的理解。這應當被視為獲得18單元版本課程的原因而不只是得到額外6個單元。

 

兩個版本專題的截止日期相同

 

專題回顧

 

每個組需要與助教規劃一個周會來討論專題狀態。這是一個使學生有機會闡明專題執行細節的關鍵會議。助教對每名學生的能力和貢獻的回饋將反映在學生參與情況中。

 

助教辦公時間

 

助教將會訂定其每週辦公時間,並會於那時間出現在其辦公室內。這將提供額外的與助教面談的時間。這些時間將在以後公佈。如果你想在其他時間見助教,請打電話或發電子郵件以安排一個面會。

 

計分

 

.不會有補考。如果你因一個合理的原因而無法參加測試,(請)在測試前與一位教師進行說明。

 

.在傍晚前提交專題報告。對於晚交的專題作業將會有扣減10%分數的處罰。然而,在下一專題的截止日期前,目前的專題必須被完成。

 

.對於每份專題作業,所有組員將會得到相同的分數。然而,如果我們感到一個組的某位成員對他/她的部分有較高貢獻或沒能承擔責任,我們將據此調整他/她的成績。因此,你讓助教知道小組進度以及你對專題的貢獻是重要的。

 

課程的總體成績將根據下列比例分配:

 

 

計分標準

 

活動

百分比

編譯器專題

58%

 

論文討論

12%

 

隨堂測試

30%

 

 

 

確保你瞭解你的最終成績是如何被計算的。關於專題成績如何計算的附加細節將在專題部分說明。

 

閱讀並討論論文

 

今年6.035的新特色之一是我們希望你去閱讀我們提供的論文,並與一位教授或助教對論文進行一對一討論。本章將介紹我們希望就這一新特色所能完成的事,以及當你閱讀論文並與我們討論時我們希望你能做到的事。

 

.我們希望達成的是使論文成為交流當前研究結果的主要方法。不像教科書等標準指導資料,論文通常由進行研究的個人或小組在研究完成後僅僅很短時間內完成。因此論文趨向於反映個人進行研究的觀點,並且該觀點可能與同一領域內的他人觀點有所區別。如果論文在研究完成後很快去寫,則研究的要點和該領域內的整體結構可能尚未可知。這樣的論文可能會忽略他人日後發現的一些概念,而這些概念在適當環境下對理解該文是至關重要的。

 

我們給你閱讀的一些論文將特別表現幾年前研究員對其所進行的研究的一些觀點。這裏強調的並不是新的成果,而是理解在某個領域的總體背景下研究的重要性,這些領域依靠研究而取得極大發展。

 

因此我們相信,當你閱讀一篇論文時,在頭腦裏保持你自己的觀點並根據你的知識來解釋論文發表後領域的發展十分重要。別忘了欣賞論文裏任何體現作者心得之處!

 

.我們希望你做到的是:首先,我們希望你閱讀論文並對兩方面的討論作好準備:現實狀況和你對研究的看法。許多論文表述了一門做事的技術(在本課程中,典型的有編譯器建構或程式設計語言)以及作者之後嘗試將該技術應用於特定實驗資料而獲得一些實驗結果。我們希望你知道實驗結果是論文的客觀真相這一事實。我們希望你知道事實並能表述它們。一旦你理解了事實,你需要深化對研究的看法並能進行討論,並潛在地為該看法辯護。這裏是一些可能幫你形成看法的問題:

 

1.你是否喜歡研究?你是否發現有趣的技術?

 

2.研究的背景是什麼?在進行研究前該領域的情況是什麼?如何用研究來改變這些事?

 

3.是否有東西使你對論文感到驚訝?你在閱讀論文時是否獲得一些你能加以推廣或應用到其他領域的心得?

 

4.實驗結果是否能讓你評估被提議的技術?你是否希望看到不同的資料或一個重新設計的實驗?是什麼限制或目標使作者進行這樣的實驗?

 

5.作者是否理解他們研究的更廣泛的分枝?他們對研究是何看法?你是否有不同的看法?

 

6.論文完成後情況是如何變化的?研究是否隨著時間變得更為有趣和相關?其他人是否在進行基於該研究的研究?還是所有努力對未來的發展顯得不相關?

 

7.在未來研究有多重要?

 

最後,寫一份150200字的論文總結來為一對一的討論會作準備。

 

未完成

 

 未完成僅僅在異常情況下才會出現,並且僅當未完成的情況為其他部份的工作已完成到某種程度時。引用麻省理工課程目錄的話來說:“‘未完成的成績僅適用於所要求作業的一小部分沒有被完成,而需完成作業才可獲得合格成績

 

合作工作的方針

 

〈與學術誠信相關的系所指導〉要求我們告知你我們在學術行為上的期望。對於家庭作業或第一個專題作業,你被允許與任何人討論問題要求和背景內容。然而,你真正提交的方案應該是你自己獨立的工作。對於專題作業的其餘部分,你可以與任何人討論背景內容,問題要求,解決方法和設計,但你不能看到任何人為6.035所寫的任何代碼,包括之前學生所寫的代碼。真正的編碼應該僅僅是你組裏的工作。所有測驗要求獨立完成。過去,許多學術違規事例因對部分學生的糟糕判斷,這些學生發現他們較晚才開始做作業或感到他們不能完成一項任務。請牢記長期的學術違規將對你的事業造成巨大傷害,這些傷害比你在6.035裏得到糟糕成績要大得多。請現在就思考這一問題,從而在本學期裏當你發現你自己暫時地疲勞、壓力大、絕望和嘗試去違犯合作工作的方針時不會放棄自己的前途。處理學術違規事件需要課程教員大量的無建設性的努力。如果我們在本學期需處理到任何一件這樣的情況,我們將會很不愉快。除此之外,我們將盡最大可能以大學的立場將此行為起訴。

 

教學時程

 

下面這份時程表提供了課程講座、復習、一對一討論會、專題和測試的資訊。對於一對一討論會,學生應該閱讀指派的論文並且在於教授或助教的單獨討論會中討論該論文。

 

時程表字母縮寫

L:講座

P:專題

R:復習

Q:測試

M:討論會

(S):Saman Amarasinghe教授的課

(M):Martin Rinard教授的課

 

第一天

第二天

第三天

第四天

1

 

 

L1: 課程管理資訊和總覽

Course Administration Information and Overview

 (S)

P1:掃描器/解析器

 Scanner/Parser Assigned

R1:掃描解析器專題Scanner Parser Project

2

L2:程式設計語言總覽

Overview of Programming Languages (M)

L3: 正則運算式,使用形式語法的語言規範

Regular Expressions, Language Specification by Formal Grammars (M)

L4:分析表建構

Parse Table Construction (M)

L5:自上至下分析法Top-down Parsing (M)

3

 

 

P1: 掃描/解析器專題截止

Scanner/Parser Project Due
P2: 指派語義檢查器專題

Semantic Checker Project Assigned

R2: 專題資訊課Project Information Session

4

L6: 中間表示法Intermediate Representations (M)

L7: 語義分析

Semantic Analysis (M)

 

 

5

Q1: 隨堂測試In-class Quiz

M1: 一對一會談One-on-One Meeting

M1: 一對一會談(續) One-on-One Meeting (cont.)

P2: 語義檢查器專題截止

Semantic Checker Project Due

P3:指派代碼生成器專題

Code Generator Project Assigned

6

 

 

R3: 專題資訊課

Project Information Session

L8:未優化的代碼生成

Unoptimized Code Generation (S)
M2: 一對一會談One-on-One Meeting

7

L9:未優化的代碼生成(續)

Unoptimized Code Generation (cont.) (S)

M2: 一對一會談(續) One-on-One Meeting (cont.)

 

 

 

8

 

P3:代碼生成專題檢查點

Code Generator Project Checkpoint

 

 

9

P3: 代碼生成專題截止

Code Generator Project Due

L10: 程式分析和優化導論

Introduction to Program Analysis and Optimization (M)

P4:指派資料流程優化器專題

Data-flow Optimizer Project Assigned

L11: 資料流程分析Data-flow Analysis (M)

L12: 資料流程優化Data-flow Optimizations (M)

M3: 一對一會談One-on-One Meeting

L13:資料流程分析基礎

Foundations of Data-flow Analysis (M)
M3: 一對一會談(續)

One-on-One Meeting (cont.)

10

Q2: 隨堂測試In-class Quiz

R4:專題資訊課

Project Information Session

 

 

11

 

 

 

P4:資料流程優化器專題檢查點

Data-flow Optimizer Project Checkpoint

12

 

 

P4:資料流程優化器專題截止

Data-flow Optimizer Project Due

P5:指派指令優化器專題

Instruction Optimizer Project Assigned

 

13

R5:專題資訊課Project Information Session

 

L14: 指令調度Instruction Scheduling (S)

 

L15:指令調度(續) Instruction Scheduling (cont.) (S)

L16:寄存器分配Register Allocation (S)

14

L17: 所有模組綜合Putting it all Together (S)

Q3: 隨堂測試

In-class Quiz

 

 

15

P5: 指令優化器專題截止

 Instruction Optimizer Project Due

 

L18: 編譯器競賽Compiler Derby (S)

 

 

 

相關閱讀資料

本課程並沒有必讀材料;然而,可選的閱讀資料將提供給希望瞭解更多關於編譯器的設計與實際操作的學生。

 

可選教材

Appel, Andrew W. 《在Java®中現代編譯器的實際操作》 Modern Compiler Implementation in Java®. Cambridge, UK: Cambridge University Press, 1997. ISBN: 0521583888.

一本關於編譯器實際操作的教材,包括針對很多語言特徵的技術。(虎書)(Tiger book)

 

Aho, Alfred V., Ravi Sethi, and Jeffrey Ullman. 《編譯器:原理、技術和工具》 Compilers: Principles, Techniques and Tools. Reading, MA: Addison-Wesley, 1986. ISBN: 0201100886.

關於編譯器的經典教材,雖然從前期的重點可以看出該書的年代久遠。(龍書)(Dragon book)

 

Muchnick, Steven. 《高級編譯器設計和實現》Advanced Compiler Design and Implementation. 1st ed. San Mateo, CA: Morgan Kaufman, 1997. ISBN: 1558603204.

這本書有關於優化的完全解決方案,十分完整,適用與行業人員和研究者。(鯨書)(Whale book)

 

Cooper, Keith, and Linda Torczon. 《編譯器製作》. Engineering a Compiler San Mateo, CA: Morgan Kaufman, 2003. ISBN: 155860698X.

一本現代教材,後面部份有不斷增加的強調重點和實現技術。(方舟書)(Ark book)

 

論文閱讀資料

 

Backus, J. W., R. J. Beeber, S. Best, and R. Goldberg, et al.FORTRAN自動編碼系統〉"The FORTRAN Automatic Coding System." 《西方聯合電腦會議錄》Proceedings of the Western Joint Computer Conference, Los Angeles, California (February 1957).

 

Smith, Randall B., and David Ungar. 〈程式設計經驗:自我啟發〉"Programming as an Experience: The Inspiration for Self."ECOOP'95, LNCS 952會議錄》Proceedings of ECOOP'95, LNCS 952, Springer Verlag (1995).

 

 

課堂講稿

需要特定軟體來使用課程中的部分檔案:.rm, .mp3.

 

除了可下載的課堂講稿,下面還提供了某些課程(L)和復習課(R)的影片和聲音。

(S):Saman Amarasinghe教授的課

(M):Martin Rinard教授的課

 

課程單元

VIDEOs

AUDIO

L1

課程管理資訊和總覽Course Administration Information and Overview (S) (PDF)

(RM - 56K)
(RM - 220K)

(MP3 - 11.3MB)

R1

 

掃描解析器專題

(由Punyashloka Biswal提供並授權使用。)Scanner Parser Project (PDF) (Courtesy of Punyashloka Biswal. Used with permission.)

(RM - 56K)
(RM - 220K)

(MP3 - 11.2MB)

L2

程式設計語言總覽Overview of Programming Languages (M)

 

 

L3

正則運算式,使用形式語法的語言規範Regular Expressions, Language Specification by Formal Grammars (M)

 

 

L4

分析表建構

Parse Table Construction (M)

 

 

L5

自上至下分析法Top-down Parsing (M)

 

 

L6

中間表現

Intermediate Representations (M)

 

 

L7

語義分析

Semantic Analysis (M)

 

 

L8

 

未優化的代碼生成Unoptimized Code Generation (S) (PDF)

(RM - 56K)
(RM - 220K)

(MP3 - 13.3MB)

L9

未優化的代碼生成(繼續)

Unoptimized Code Generation (cont.) (S) (PDF)

(RM - 56K)
(RM - 220K)

(MP3 - 13.3MB)

L10

程式分析和優化導論Introduction to Program Analysis and Optimization (M)

 

 

L11

資料流程分析

Data-flow Analysis (M)

 

 

L12

資料流程優化

Data-flow Optimizations (M)

 

 

L13

資料流程分析基礎Foundations of Data-flow Analysis (M)

 

 

L14

指令調度

Instruction Scheduling (S) (PDF)

(RM - 56K)
(RM - 220K)

(MP3 - 11.9MB)

L15

指令調度(續)

Instruction Scheduling (cont.) (S) (PDF)

(RM - 56K)
(RM - 220K)

(MP3 - 11.4MB)

L16

寄存器分配

Register Allocation (S) (PDF)

(RM - 56K)
(RM - 220K)

(MP3 - 11.5MB)

L17

所有模組綜合

Putting it all Together (S) (PDF)

(RM - 56K)
(RM - 220K)

(MP3 - 9.1MB)

L18

編譯器競賽

Compiler Derby (S)

 

 

 

 

測驗

 

本章節包含無法被螢幕閱讀軟體讀取的文檔。採用“#”符號用來標記此類文檔。

 

本部份包含本課程提供給學生的測試練習。

 

年份

測驗

1999年秋

模擬測試1 (PDF)

2005年秋

模擬測試2 (PDF)

2004年秋

模擬測試3 (PDF)#

 

專題

 

6.035的主要課程工作是一個編譯器的設計與實現。在課程的每一階段,編譯器的一個部分將被建構。五部分分別是:掃描和解析器、語義檢查器、代碼生成器、資料流程優化器和指令優化器。五項作業都是小組專題。學生能在兩個版本的編譯器專題中進行選擇:一個18單元版本(需花費更多時間)和一個12單元版本。12單元版本專題提供一次實作建造一個簡單而完整編譯器的經歷。18單元版本專題還用於闡明一些真實世界中建構適用於行業的編譯器的問題。這部分的專題文檔採用Athena這一基於麻省理工學院的UNIX計算環境的軟體。

 

專題總覽Project Overview (PDF)

脫咖啡因咖啡描述Decaf Spec (PDF)

掃描器/解析器專題Scanner/Parser Project (PDF)

語法專題Semantics Project (PDF)

代碼生成專題Code Generation Project (PDF)

講義9附錄:X86-64位元架構指南Appendix to Handout 9: X86-64 Architecture Guide (PDF)

資料流程優化專題Dataflow Optimization Project (PDF)

底層優化專題Low-level Optimization Project (PDF)

相關資源

這部分提供一些與課程主題相關的網站連結

 

‧在Java®中的現代編譯器實實務操作Modern Compiler Implementation in Java®

Jlex掃描器生成器JLex Scanner Generator

CUP解析器生成器:手冊CUP Parser Generator: Manual

Java® 1.5.0文檔(語言和工具)Java® 1.5.0 Documentation (Language and Tools)

CVS-並行版系統CVS - Concurrent Versions System

GNU製作GNU Make

Apache™螞蟻Apache™ Ant

AT&T組合語言程式語法AT&T Assembler Syntax

 

 

6.035 Computer Language Engineering (SMA 5502)

Fall 2005

Image of a computer screen.Computer screen. (Photo © openphoto.net.)

Course Highlights

This course features all of its lecture notes and a selection of videos in the lecture notes section. Separate project assignments are provided in the projects section. In addition, practice quizzes are available in the exams section.

Course Description

6.035 is a course within the department's "Computer Systems and Architecture" concentration. This course analyzes issues associated with the implementation of high-level programming languages. Topics covered include: fundamental concepts, functions, and structures of compilers, basic program optimization techniques, the interaction of theory and practice, and using tools in building software. The course features a multi-person project on design and implementation of a compiler that is written in Java® and generates MIPS executable machine code. This course is worth 8 Engineering Design Points.

This course was also taught as part of the Singapore-MIT Alliance (SMA) programme as course number SMA 5502 (Computer Language Engineering).



Special Features

Sample video lectures Sample audio lectures

Technical Requirements

Special software is required to use some of the files in this course: .rm, .mp3.




*Some translations represent previous versions of courses.





Syllabus

Prerequisite

6.170 and proficiency in Java®



Class Format

The lectures, problem sets and exams of 6.035 are structured around the compiler project, which is divided into five segments. Each segment addresses a separate aspect of compiler construction. Each segment (except the first) consists of a series of lectures, a programming assignment and a problem set or an in-class quiz.

At the beginning of a segment, the programming assignment will be given. Next, a series of lectures will introduce the material. The remaining time of the segment will be devoted to the project, thus no classes will be held. Each group should schedule a weekly "project review" meeting with your TA to discuss the design decisions, project progress and group status. A segment comes to an end on the due date of the project assignment. The calendar outlines the schedule and Handout 4 "Project Overview" expands on the project details. In addition to the projects, there will be three in-class quizzes and four paper assignments, which will include a one-on-one paper discussion with a staff member.



The Project

The main course work of 6.035 is the design and implementation of a compiler. In each segment of the course, a part of the compiler will be constructed. The five segments are the scanner and parser, semantic checker, code generator, data-flow optimizer, and instruction optimizer. All the five assignments are group projects.

As in previous years, we are offering two versions of this compiler project, an 18-unit version and a 12-unit version. All members of a project group should register for the same number of units. All students should register for 6.035 (12 units). Those wishing to do the more ambitious project should also register for 6.907 (6 units) by Add Date. A professor's signature is not required on an Add form for 6.907. The grade for the six extra units will be based solely on the project.

The 12-unit version of the project is for the health-conscious: You will be served Decaf to get a hands-on experience of building a simple yet complete compiler. In the 18-unit version of the project, you will be served a strong, steaming Espresso to enable you to also experience some of the real world problems that arise in building industrial-strength compilers.

We offer the more difficult project and the six extra units to provide interested students with an opportunity to gain a deeper understanding of the issues involved in building a compiler. This should be seen as the reason for undertaking the 18-unit version of the course, not simply to get extra six units.

The due dates will be the same for both versions of the project.



Project Review

Each group needs to schedule a weekly meeting with the TA to discuss the project status. This is a critical meeting where the students have a chance to clarify the implementation details of the project. Student participation will provide the TA's feedback on the competency and contribution of each student.

TA Office Hours

The TA will set his own office hours and will spend those hours each week in his office. This will provide additional "face time" with the TA. These hours will be announced later. If you wish to see the TA at some other time, call or send e-mail to arrange a meeting.



Grading

No make-up quizzes will be given. If you are unable to take a quiz for a legitimate reason, talk to one of the instructors before the quiz.

Hand in the project write-up which is due before evening. For late project assignments a penalty of 10% will be imposed. However, the project has to be completed before the due date of the next project.

For each project assignment, all the members of a group will get the same grade. However, if we feel that a particular member of a group is contributing above and beyond his or her share or not carrying the weight we will adjust his or her grade accordingly. Therefore it is important that you keep your TA updated with the progress of your group and your contributions to the project.

The overall grade for the class will be assigned using the following weights:


Grading criteria. ACTIVITIES PERCENTAGES
Compiler Project 58%
Paper Discussion (3% each) 12%
In-class Quizzes (10% each) 30%



Make sure you understand how your final grade will be calculated. Additional details about how the project grade is calculated are available in the projects section.



Reading and Discussing Papers

One of the new features of 6.035 this year is that we will be expecting you to read papers we hand out, then come and discuss the paper one-on-one with one of the professors or TAs. This section will describe what we are expecting to accomplish with this new feature and what we are expecting from you when you read the paper and discuss it with us.

What we are expecting to accomplish: Papers are the primary means of communicating current research results. Unlike standard instructional materials such as textbooks, papers are usually written by the person or group doing the research, and often only a short period of time after the research has been completed. Papers therefore tend to reflect the perspective of the person doing the research, and this perspective may differ from the perspective of others in the field. If the paper was written soon after the research was completed, the impact of the research and the full structure of the field may not yet be known. The paper may be missing key concepts that others will later find crucial to understanding the paper in its proper context.

Some of the papers we will give you to read will be perspective papers written specifically to present the perspective of a researcher about research performed years earlier. Here the emphasis is not on new results, but on understanding the importance of the research in the overall context of a field that may have developed significantly since the research was performed.

We therefore believe that when you read a paper, it is important to keep your own perspective in mind and interpret the results in light of your knowledge of how the field has developed after the paper was published. And appreciate any of the author's insights that come through in the paper!

What we are expecting from you: Basically, we expect you to read the paper and be prepared for two areas of discussion: the facts and your opinion of the research. Many papers present a technique for doing something (in this course, typically some aspect of compiler construction or programming languages) and then some experimental results the authors obtained by trying the technique out in some experimental setting. Together, the technique and the experimental results are the objective facts of the paper. We expect you to know the facts experimental results are the objective facts of the paper. We expect you to know the facts and be able to present them.
Once you understand the facts, you need to develop an opinion of the research and be able to discuss and potentially defend that opinion. Here are some questions that may help you form your opinion:

Do you like the research? Did you find the techniques presented fun and interesting?

What is the context of the research? What was the state of the art in the field before the research was performed, and how did the research change things?

Did anything surprise you about the paper? Are there any insights you obtained from reading the paper that you can generalize or apply in other areas?

Do the experimental results allow you to evaluate the proposed technique? Would you have liked to see different data or a redesigned experiment? What constraints or goals shaped the experiments that the authors did perform?

Do the authors understand the wider ramifications of their research? What is their perspective on the research, and do you have a different perspective?

How have things changed since the paper was written? Has the research become more interesting and relevant over time? Have others built on the research, or was the entire effort rendered irrelevant by future developments?

How important will the research be in the future?

Finally, write a 150 to 200 word summary of the paper to prepare for the one-on-one meeting.



Incompletes

Incompletes are only given in unusual circumstances, and only when work has been completed satisfactorily up to the point when the incomplete was requested. Quoted from the MIT Course Catalog: "The grade of I is to be used only for subjects for which a minor portion of the work required has not been completed, and when a passing grade is expected when completed."



Policy on Collaborative Work

The "Department Guidelines Relating to Academic Honesty" require that we inform you of our expectations regarding academic conduct. For homework assignments and the first project assignment, you are permitted to discuss the problem requirements and background material with anyone. However, the actual solutions you hand in should be your own individual work. For rest of the project assignments, you may discuss background material, problem requirements, approaches to problems, and design with anyone, but you may not view any code written for 6.035 by anyone, including past students. The actual coding should be the work of your group only. All exams are to be done individually. In the past, many academic misconduct cases have come about because of poor judgment on the part of students who find themselves in the position of starting an assignment late or feel that they are incapable of completing an assignment. Please bear in mind that the long-term consequences of an academic misconduct case will do much more damage to your career than the worst possible grade you can get in 6.035. Please think through the issues now so that don't lose perspective if you find yourself temporarily tired, stressed, desperate, and tempted to violate the policy on collaborative work during the semester. Dealing with academic misconduct cases requires an enormous amount of nonproductive effort for the course staff. We will not be happy if we have to deal with one of these cases this semester, and we will prosecute to the fullest extent provided for by the University relations.





Calendar

The calendar below provides information on the course's lecture, recitation, one-on-one meeting, project, and quiz sessions. For the one-on-one meetings, students read assigned papers and discuss the papers in individual meetings with the professors or teaching assistants.



Calendar Legend

L: Lecture
P: Project
R: Recitation
Q: Quiz
M: Meeting
(S): Session taught by Professor Saman Amarasinghe
(M): Session taught by Professor Martin Rinard


Course schedule. WeEK # DAY 1 DAY 2 DAY 3 DAY 4
1     L1: Course Administration Information and Overview (S) P1: Scanner/Parser Assigned

R1: Scanner Parser Project
2 L2: Overview of Programming Languages (M) L3: Regular Expressions, Language Specification by Formal Grammars (M) L4: Parse Table Construction (M) L5: Top-down Parsing (M)
3     P1: Scanner/Parser Project Due

P2: Semantic Checker Project Assigned
R2: Project Information Session
4 L6: Intermediate Representations (M) L7: Semantic Analysis (M)    
5 Q1: In-class Quiz M1: One-on-One Meeting M1: One-on-One Meeting (cont.) P2: Semantic Checker Project Due

P3: Code Generator Project Assigned
6     R3: Project Information Session L8: Unoptimized Code Generation (S)

M2: One-on-One Meeting
7 L9: Unoptimized Code Generation (cont.) (S)

M2: One-on-One Meeting (cont.)
     
8   P3: Code Generator Project Checkpoint    
9 P3: Code Generator Project Due

L10: Introduction to Program Analysis and Optimization (M)

P4: Data-flow Optimizer Project Assigned
L11: Data-flow Analysis (M) L12: Data-flow Optimizations (M)

M3: One-on-One Meeting
L13: Foundations of Data-flow Analysis (M)

M3: One-on-One Meeting (cont.)
10 Q2: In-class Quiz R4: Project Information Session    
11       P4: Data-flow Optimizer Project Checkpoint
12     P4: Data-flow Optimizer Project Due

P5: Instruction Optimizer Project Assigned
 
13 R5: Project Information Session L14: Instruction Scheduling (S) L15: Instruction Scheduling (cont.) (S) L16: Register Allocation (S)
14 L17: Putting it all Together (S) Q3: In-class Quiz    
15 P5: Instruction Optimizer Project Due   L18: Compiler Derby (S)  




Readings

Amazon logo Help support MIT OpenCourseWare by shopping at Amazon.com! MIT OpenCourseWare offers direct links to Amazon.com to purchase the books cited in this course. Click on the book titles and purchase the book from Amazon.com, and MIT OpenCourseWare will receive up to 10% of all purchases you make. Your support will enable MIT to continue offering open access to MIT courses.

There were no required readings for the course; however, optional readings were provided for students who wished to learn more about designing and implementing a compiler.



Optional Textbooks

Appel, Andrew W. Modern Compiler Implementation in Java®. Cambridge, UK: Cambridge University Press, 1997. ISBN: 0521583888.
A textbook tutorial on compiler implementation, including techniques for many language features. (Tiger book)

Aho, Alfred V., Ravi Sethi, and Jeffrey Ullman. Compilers: Principles, Techniques and Tools. Reading, MA: Addison-Wesley, 1986. ISBN: 0201100886.
The classic compilers textbook, although its front-end emphasis reflects its age. (Dragon book)

Muchnick, Steven. Advanced Compiler Design and Implementation. 1st ed. San Mateo, CA: Morgan Kaufman, 1997. ISBN: 1558603204.
Essentially a recipe book of optimizations; very complete and suited for industrial practitioners and researchers. (Whale book)

Cooper, Keith, and Linda Torczon. Engineering a Compiler. San Mateo, CA: Morgan Kaufman, 2003. ISBN: 155860698X.
A modern classroom textbook, with increased emphasis on the back-end and implementation techniques. (Ark book)



Paper Readings

Backus, J. W., R. J. Beeber, S. Best, and R. Goldberg, et al. "The FORTRAN Automatic Coding System." In Proceedings of the Western Joint Computer Conference, Los Angeles, California (February 1957).

Smith, Randall B., and David Ungar. "Programming as an Experience: The Inspiration for Self." Proceedings of ECOOP'95, LNCS 952, Springer Verlag (1995).





Lecture Notes

Special software is required to use some of the files in this section: .rm, .mp3.

These files are also available on iTunes® and YouTube™.

In addition to downloadable lecture notes, video and audio files of select lecture (L) and recitation (R) sessions are provided below.

(S): Session taught by Professor Saman Amarasinghe
(M): Session taught by Professor Martin Rinard


Class notes and lecture videos. SES # TOPICS VIDEOs AUDIO
L1 Course Administration Information and Overview (S) (PDF) (RM - 56K)
(RM - 220K)
(MP3 - 11.3MB)
R1 Scanner Parser Project (PDF) (Courtesy of Punyashloka Biswal. Used with permission.) (RM - 56K)
(RM - 220K)
(MP3 - 11.2MB)
L2 Overview of Programming Languages (M)    
L3 Regular Expressions, Language Specification by Formal Grammars (M) (PDF)    
L4 Parse Table Construction (M) (PDF)    
L5 Top-down Parsing (M) (PDF)    
L6 Intermediate Representations (M) (PDF)    
L7 Semantic Analysis (M) (PDF)    
L8 Unoptimized Code Generation (S) (PDF) (RM - 56K)
(RM - 220K)
(MP3 - 13.3MB)
L9 Unoptimized Code Generation (cont.) (S) (PDF) (RM - 56K)
(RM - 220K)
(MP3 - 13.3MB)
L10 Introduction to Program Analysis and Optimization (M) (PDF)    
L11 Data-flow Analysis (M) (PDF)    
L12 Data-flow Optimizations (M) (PDF)    
L13 Foundations of Data-flow Analysis (M) (PDF)    
L14 Instruction Scheduling (S) (PDF) (RM - 56K)
(RM - 220K)
(MP3 - 11.9MB)
L15 Instruction Scheduling (cont.) (S) (PDF) (RM - 56K)
(RM - 220K)
(MP3 - 11.4MB)
L16 Register Allocation (S) (PDF) (RM - 56K)
(RM - 220K)
(MP3 - 11.5MB)
L17 Putting it all Together (S) (PDF) (RM - 56K)
(RM - 220K)
(MP3 - 9.1MB)
L18 Compiler Derby (S)    




Exams

This section contains documents that could not be made accessible to screen reader software. A "#" symbol is used to denote such documents.

This section contains practice quizzes given to students in the course.


Practice quizzes. YEARS EXAMS
Fall 1999 Practice Quiz 1 (PDF)
Fall 2005 Practice Quiz 2 (PDF)
Fall 2004 Practice Quiz 3 (PDF)#




Projects

The main course work of 6.035 is the design and implementation of a compiler. In each segment of the course, a part of the compiler will be constructed. The five segments are: the scanner and parser, semantic checker, code generator, data-flow optimizer and instruction optimizer. The five assignments are all group projects. Students may choose between two versions of the compiler project: an 18-unit version (more time consuming) and a 12-unit version. The 12-unit version of the project is intended to provide a hands-on experience of building a simple yet complete compiler. The 18-unit version of the project is intended to also illustrate some of the real world problems that arise in building industrial-strength compilers. The project documents in this section refer to Athena, which is MIT's UNIX®-based computing environment.

Project Overview (PDF)

Decaf Spec (PDF)

Scanner/Parser Project (PDF)

Semantics Project (PDF)

Code Generation Project (PDF)

Appendix to Handout 9: X86-64 Architecture Guide (PDF)

Dataflow Optimization Project (PDF)

Low-level Optimization Project (PDF)





Related Resources

This section provides links to Web sites that are relevant to the course topics.

Modern Compiler Implementation in Java®

JLex Scanner Generator

CUP Parser Generator: Manual

Java® 1.5.0 Documentation (Language and Tools)

CVS - Concurrent Versions System

GNU Make

Apache™ Ant

AT&T Assembler Syntax




留下您對本課程的評論
標題:
您目前為非會員,留言名稱將顯示「匿名非會員」
只能進行20字留言

留言內容:

驗證碼請輸入0 + 8 =

標籤

現有標籤:1
新增標籤:


有關本課程的討論

課程討論
真是太想吃屌了

Anonymous, 2011-04-08 02:58:48

Creative Commons授權條款 本站一切著作係採用 Creative Commons 授權條款授權。
協助推廣單位: