Each of these project ideas will be discussed in lecture, and textbook chapters are available for some of them.
Extend the tuples present in Lfun to records with named fields, exposed as classes in the language. There is no chapter in the textbook describing this extension, but we’ll discuss it in class.
Example:
class Point:
x: int
y: int
def add_point(self: Point, other: Point) -> Point:
return Point(self.x + other.x, self.y + other.y)
p1 = Point(1, 2)
p2 = Point(3, 4)
p3 = add_point(p1, p2)
Extend the Lfun language to support lexically-scoped functions at
the top level. We will discuss this option in class, and the textbook
describes the changes in Chapter 9. Support for lambda
expressions
is optional, and more challenging due to changes in the parser.
Example:
x = 5
def f() -> int:
return x
x = 6
print(f())
Extend the Lfun language to support dynamic typing as described in Chapter 9 of the textbook.
Example:
if 5 == 6:
x = True
else:
x = 42
More complicated:
Very tough:
The goal of the final project is for you to design and implement your own compiler extension. Final projects will be completed in groups of 1-3. Your project should be similar in size and scope to a single homework assignment. For groups of size >1, the project should be similar in size and scope to one homework assignment for each group member. The deliverables for the project will be as follows:
For the project milestone, you should submit:
compiler.py
if you didn’t modify any other files, or a .zip file containing the whole compiler directory if you didThe final project is worth 10% of your final grade. The schedule for final project deliverables, and the contribution of each one to the grade you receive for the final project, are as follows:
Deliverable | Due Date | Grade Percent | Turn In |
---|---|---|---|
Project Proposal | Monday, Apr 15 at 11:59pm | 10% | Brightspace |
Project Milestone | Monday, Apr 29 at 11:59pm | 10% | Brightspace |
Implementation & README | Wednesday, May 8 at 11:59pm | 50% | Brightspace |
Project Presentation Video | Wednesday, May 8 at 11:59pm | 30% | Brightspace |