Overview
For this project, you will design, implement, evaluate, and document your own domain-specific language. This will be a significant effort on your part, and the project makes up 30% of your grade in this course. There will be periodic milestones during the second half of the semester, to help keep you on track and to provide you feedback as you work on your language.
Other than the deadlines and requirements described below, you have complete freedom. In particular, you're free to choose the domain and host language in which you will implement your DSL. You should choose a domain that really interests you or for which having a DSL would improve yours or others' programming productivity.
Teamwork
You may work either by yourself or with one other person. I recommend you work with someone else so that you can collaborate on language design.
The entire class also acts as a team. Three times this semester, every person or pair will discuss the current state of their project with the rest of the class. The class, in turn, will be asked to provide helpful feedback on your project.
Milestones, Deliverables, and Deadlines
These are the due dates for the milestones and project materials. Details about each of these are provided in the next section. The percentages next to each milestone is how much of the total project each milestone is worth. Remember: there are no late days for project milestones.
Detailed Requirements
This section contains more detailed instructions for completing and submitting each milestone.
Choose a domain and partner, if applicable
October 19, 9pm Pacific (5%)
Send me an email that contains a one-paragraph response for each of answers the following questions:
- What domain will your language address?
- Why or how could this domain benefit from a DSL?
- Are you working in a pair? If so, say with whom. Only one of the pair needs to send me the email, cc-ing their partner.
Teaser
October 26, 1:15pm Pacific (5%)
The goal of this assignment is to get the rest of the class excited about your project. You will give a three-minute, in-class presentation that provides slightly more detailed answers to above questions. In particular, you should:
- introduce us to the domain
- convince us that the domain is important
- tell us why the domain could benefit from a DSL
- describe the potential users of your DSL
The nature of the presentation is for you to decide. Use any technique (e.g., slides, whiteboard, talking, pantomime) that you think is most effective to introduce your project to the rest of the class.
Project Plan
November 7, 9am Pacific. (15%)
The project plan is a rough draft of your final write-up, with a focus on design. It should address the following concerns:
- Domain: Describe your domain and motivate the need for a DSL (i.e., how could domain-experts use and benefit from a DSL?)
- Language overview: Answer the following questions:
- What is the basic computation that your language performs (i.e., what is the computational model)?
- What are the basic data structures in your DSL? How does a the user create and manipulate data?
- What are the basic control structures in your DSL? How does the user specify or manipulate control flow?
- What kind(s) of input does a program in your DSL require? What kind(s) of output does a program produce?
- Error handling: How might programs go wrong, and how might your language communicate those errors to the user?
- Are there any other DSLs for this domain? If so, what are they, and how will your language compare to these other languages?
- Implementation plan: How do you plan to implement your language? In particular, what host language do you intend to use, and why is the host language well-suited for this project?
- Teamwork plan: If you are working in a pair, how do you plan to divide the labor? Note: Each team member must work on every aspect of the project, including design, implementation, evaluation, and documentation.
Commit a PDF of your project plan into your (group's) SVN directory by the November 7 deadline.
Design and Implementation Discussion
November 14 & November 16 (15%)
You will present your project plan to the rest of the class, and discuss what implementation progress you have made. Note: This means that you will need to have made significant progress on your implementation by this point.
Your discussion should be 9 minutes long and should address the following areas:
- A brief reminder of the goals for your project (< 1 minute)
- An explanation of your design and implementation decisions so far (~5 minutes). These decisions include (but are not limited to):
- Your host language (and justification)
- Internal vs. external implementation (and justification)
- Syntax design decisions
- How you plan to map the syntax to your domain's computational model
- Specific question(s) for the audience (~3 minutes). Find a way to use the audience to further your project. For example, they could vote on syntactic choices or language features, or they could help you brainstorm ways to implement your syntax, etc.
Demo / Presentation
November 28, November 30 & December 5. (10%)
This is your chance to show off by giving a demo of your DSL for the class. In particular, we want to see:
- Cool things that a programmer can do in your language (i.e., how are you easing domain experts' pain?). This is the "demo" part of the presentation: be sure to show us some example programs and their execution.
- Crafty techniques you used to implement your language (e.g., is there a set of simple semantic building blocks that you composed, or did you try something unexpected to overcome challenges in syntax design, environment design, etc.?)
- Interesting insights you had into language design and implementation (e.g., what did you think would be easy that wasn't, what did you think was difficult that wasn't, how would you advise other implementers of DSLs in your domain or otherwise, what would you do differently next time, what would you add/change if you had more time, etc.?).
Note: This means that, by the day of your demo, your implementation should be almost complete.
Your demo will have a twelve-minute time limit, with a little bit of flex time for questions.
Final code
December 9, 9pm Pacific (25%)
Submit all the code for your language, along with a few sample programs and instructions for running them. Your code should follow good practices. In particular, it should be well-architected (i.e., modular), and well-documented with comments.
Make the final commit of your code to your (group's) SVN directory by the December 9 deadline.
Final write-up
December 9, 9pm Pacific (25%)
Your write-up should describe your domain, your language, and your design and implementation processes. Specifically, it should have the following format:
- Introduction: Describe your domain and motivate the need for a DSL (i.e., how could domain-experts use and benefit from a DSL?)
- Language Overview: Give a high-level overview of your language. Be sure to answer the following questions and note any changes from your project plan:
- How does a user write programs in your language (e.g., do they type in commands, use a visual/graphical tool, speak, etc.)?
- What is the basic computation that your language performs (i.e., what is the computational model)?
- What are the basic data structures in your DSL? How does a the user create and manipulate data?
- What are the basic control structures in your DSL? How does the user specify or manipulate control flow?
- What kind(s) of input does a program in your DSL require? What kind(s) of output does a program produce?
- Error handling: How can programs go wrong, and how does your language communicate those errors to the user?
- What tool support (e.g., error-checking, development environments) does your project provide?
- Are there any other DSLs for this domain? If so, what are they, and how does your language compare to these other languages?
- Example program(s): Provide one or more examples that give the casual reader a good sense of your language. Include inputs and outputs. Think of this section as "Tutorial By Example".
- Language Design: Describe and the syntax and semantics of your program. Justify the design choices you made. This section should answer the following questions:
- How does the syntax of your language help users write programmers more easily than the syntax of a general-purpose language?
- What are the semantic abstractions / building blocks of your DSL?
- Language Implementation: Describe your implementation. In particular, answer the following questions:
- What host language did you use (i.e., in what language did you implement your DSL)? Why did you choose this host language (i.e., why is it well-suited for your language design)?
- Parsing: How does your DSL take a user program and turn it into something that can be executed? How do the data and control structures of your DSL connect to the underlying semantic model?
- Execution: How did you implement the computational model? Describe the structure of your code and any special programming techniques you used to implement your language. In particular, how do the semantics of your host language differ from the semantics of your DSL?
- Evaluation: Provide some analysis of the work you did. In particular:
- What works well? What are you particularly pleased with?
- What could be improved? For example, how could the user's experience be better? How might your implementation be simpler or more cohesive?
- Where did you run into trouble and why? For example, did you come up with some syntax that you found difficult to implement, given your host language choice? Did you want to support multiple features, but you had trouble getting them to play well together?
- If you worked as a pair, describe how you divided your labor.
Commit a PDF of your write-up to your (group's) SVN directory by the December 9 deadline.