Here's our first assignment! Please carefully read all parts of this document before you start working.
In this assignment, you'll:
- Practice using GitHub to work on and submit your assignments.
- Write a program in an interesting DSL: ContextFree.
- Read some introductory material about DSLs, which will give us some shared terminology for talking about DSLs and their implementations.
- Use what you learned from the reading to understand and critique ContextFree's design.
These parts of the assignment are due by Monday, March 12 at 8:59pm, Pacific Daylight Time. (Click on the link to view a world clock that converts to your local time.)
Also, as with all assignments, you'll:
- Critique each other's work
- Identify some discussion questions for our next meeting.
The critiques and discussion questions are due by Thursday, March 15 at 8:59pm, Pacific Daylight Time.
After this assignment, you should be able to:
- Recognize properties of a DSL, and evaluate those properties using common terms.
- Write in at least two DSLs (ContextFree and Markdown).
- Use GitHub as a submission system.
My goal is for you to spend no more than 8 hours on this assignment (including critique time). As you work, please keep a rough account of how long you're spending on the assignment. If it looks like you're going to spend more than 8 hours, please contact me on Schoology, so we can make adjustments.
For the technical part of the assignment, you'll work by yourself (though you're free to discuss the assignment with anyone else in the class, on Schoology). For the critique part of the assignment, you'll review someone else's work.
This article describes how we'll do our assignments on GitHub. Be sure to read it before you start working on your assignment.
Practice the assignment workflow by submitting your code for the "nested parentheses" Coding Bat example.
You've already forked the repository from the class's GitHub organization, so now you need to:
- Clone it to your own computer.
- Modify the code on your own computer so that it contains your solution.
- Commit and push your local code back to your GitHub fork.
- Submit a pull request from your fork on GitHub.
You don't need to do a peer review on anyone else's code, but feel free to look at other people's code if you want!
I anticipate that you'll have questions. Please ask them right away on Schoology!
Now that you've practiced the GitHub workflow, get started on the rest of the assignment by forking this repository. All the remaining work on this assignment will be done in your fork.
-
Download ContextFree, a domain-specific language for making art. You should download version 2.2, which is not the current version of the language. (download links: Windows, Mac, Linux). The version 2.2 documentation is here. When you open ContextFree, it might ask you to update the program; but you should ignore that request. Use the old version (2.2) instead.
-
Write an interesting ContextFree program. Save your program in a file called
firstname_lastname.cfdg
(where you fill in your first and last names). -
Export a nice image from your program. (Choose the
Render
menu, thenSave Image...
) Use a.png
extension, so your filename should befirstname_lastname_variant.png
(wherevariant
is the three-letter variant the uniquely identifies this version of your program).
Read Fowler, Chapter 2.1 For the most part, this reading is self-contained. In a few places, Fowler references other parts of the book. Ignore these references; you can understand the reading without them. It may be helpful to know that, in Chapter 1, Fowler described a domain called "Miss Grant's Controller". You can safely substitute ContextFree's domain in place of Miss Grant's Controller.
1 This copy of the reading is for class use only. You should not distribute it to anyone outside the class. You should destroy your digital copy when the class is over.
Based on your reading and your use of ContextFree, answer the questions in
context-free.md
.
Your name is on the left side of this table; the person whose work you should review is on the right side of this table:
Your name | Your will critique this person's work |
---|---|
Eesha Agarwal | Wiecheng Zeng |
Chieh-Hsiu (Jerry) Hung | Yufan (Harry) Liu |
Yufan (Harry) Liu | Eesha Agarwal |
Wiecheng Zeng | Chieh-Hsiu (Jerry) Hung |
Once your partner has submitted, you can comment on their work. You should find
their work linked on the pull request page. Provide feedback on all
aspects of your partner's work, specifically the information in
context-free.md
, their code, and their image. Here are some questions you
might consider / answer when providing feedback:
- Do you agree or disagree with your partner's claims in
context-free.md
? Why? - If your partner has raised a question in
context-free.md
, try to answer it! - Did your partner describe anything that you also experienced? For example, did you try to do something in ContextFree that was difficult?
- Did you learn any cool language features (from ContextFree or Markdown) that might add to your partner's work?
Respond to the prompts in discussion-questions.md
, by editing that file.
Good responses (i.e., responses that receive a B) will:
- fully respond to every prompt in the starter file, and
- be well-written and easy to read, i.e., clear yet concise using good spelling, grammar, organization, and proper formatting, to convey a well-formed idea, and
- where appropriate, support your thoughts with references to material from the reading or from language documentation.
Great responses (i.e., responses that receive an A) will additionally:
- be particularly insightful, by using concepts from the reading to classify aspects of each DSL in the assignment and / or by disagreeing with the classification that Fowler might make and by presenting a strong argument for a different classification.
- Read the Assignment HOWTO.
- Submit a pull request for your Coding Bat code.
- Write a ContextFree program in
firstname_lastname.cfdg
. - Make and save a nice picture in
firstname_lastname_variant.png
. - Read Fowler's introduction to DSLs.
- Answer the questions in
context-free.md
. - Submit a pull request for this assignment.
- Comment on your critique partner's work.
- Respond to the prompts in
discussion-questions.md
.