Assignment 7: Garter:   Design Your Own Language Extension
1 Part I:   Written Specification
2 Part II:   Implementation
8.10

Assignment 7: Garter: Design Your Own Language Extension

Part I Due: Fri 12/01 at 11:59pm, Part II Due: 12/13 at 11:59pm

NOTE: This final, 2-part assignment, must be completed with a partner. We are releasing it early so that you have ample time to find a partner if you don’t already have one. If you have not found a partner by class time on Monday, November 19, make a private piazza post with title "Partner Needed" and we will pair you with someone else who does not have a partner.

Thus far in the class we have provided you with a specification for a new language feature or analysis and you have implemented it according to the provided specification. For this final project you will take over, and both design the language extension and implement it. The assignment is broken up into two parts: first you will submit a written document specifying the syntax, semantics and an outline for how to implement a new language feature, along with a suite of executable tests demonstrating the expected behavior. Then you will extend the compiler end-to-end to support your new feature with a robust test suite to demonstrate your new language in action.

Here are a couple of recommended features for you to choose from that should be feasible and that the professor and GSI/IAs will be most prepared to help with. We will be providing additional background resources on these topics on Piazza to help you with your design.

If you would like to choose a different language feature to implement, e-mail the professor to confirm that it is sufficient and feasible. Whatever language feature you choose it should involve both of an extension to the concrete syntax and a non-trivial extension to the remainder of the compiler.

You may choose to base your extension off of either your diamondback or egg-eater compiler, or something in between such as diamondback with arrays added but not closures. You do not need to perform register allocation for your final compiler.

1 Part I: Written Specification

For part 1 you will submit a 3-5 page technical specification for your chosen language extension in pdf format.

This document should address the first four steps of our language extension recipe we’ve seen throughout the course:

  1. Its impact on the concrete syntax of the language

  2. Examples using the new enhancements, so we build intuition

  3. Its impact on the abstract syntax and semantics of the language

  4. Any new or changed transformations needed to process the new forms

  5. Executable tests to confirm the enhancement works as intended

You will be graded on

  1. Whether you thoroughly cover all 4 of the topics above

  2. The logic of your design

  3. The clarity of your writing

  4. The thoroughness of your test suite in exploring the behavior of your new program feature

We will grade the written assignments quickly so as to quickly alert you to any design flaws we find and help you to correct them.

For this submission you should submit your usual codebase as usual but include a document docs/proposal.pdf with your written proposal, as well as your test files examples/* with automated tests for running them in tests/examples.rs, labeled with a comment /* Garter tests */ (or whatever fun snake name you decide to give to your language). The tests will fail because you haven’t implemented the feature yet.

2 Part II: Implementation

For the final submission you will implement your proposed language feature and submit the following for grading:

  1. The repository with your compiler implementation

  2. A collection of executable tests to demonstrate that your extended compiler works as intended

  3. A short pdf document detailing any changes from your submitted Part I design, if any

This should be in the following format:

You will be graded on

For this last point, your docs/updates.pdf should detail which language features from egg-eater, if any are not supported. Your implementation should at least support the features in diamondback.