Fall 2016

CS 111: Domain-Specific Languages

MW 1:15pm2:30pm in SHAN 2475

About This Course

Description

This course explores how to design a new programming language. In particular, we’ll focus on “Domain-Specific Languages”—languages designed for people who want to use a computer to perform a specialized task (e.g., to compose music or query a database or make games). Through readings, discussions, and programming, we’ll investigate why and how you would create a domain-specific language. The course also features a project that asks you to propose, design, and implement your own domain-specific language.

We’ll also investigate questions about how Computer Science and programming languages relate to society, including:

  • What counts as programming?
  • What counts as a programming language?
  • Who gets to call themselves a programmer?
  • How (much) does language influence thought?
  • How do we make software that other people will find useful?

CS 111 follows a “studio model”, where all work-in-progress is made public, and we rely on each other’s critiques to improve our work. Sample solutions are published at the beginning of the assignment, you’ll often work in teams, you’ll have access to everyone else’s work throughout the assignment, and every assignment has a peer-review component.

Learning Objectives

This course has two broad aims, each with specific objectives:

Aim 1: To familiarize you with the purpose, design, implementation, specification, and evaluation of domain-specific languages.

Objectives:

  • Compare and contrast the benefits and drawbacks of a domain-specific language versus a general-purpose language.
  • Analyze a domain and identify its semantic model(s) and linguistic abstractions.
  • Design language-based user interfaces.
  • Evaluate language design choices.

Aim 2: To give you the opportunity to explore a wide variety of high-level language-implementation techniques.

Objectives:

  • Identify the properties of a general-purpose host language that make it (un)suitable for implementing a domain specific language.
  • Explore, compare, and contrast techniques for implementing an internal versus an external DSL.
  • Learn to program in Scala.

Because DSLs are a powerful and flexible programming tool, we will explore the topic systematically and broadly, building up concepts and code that should be useful to you in your end-of-semester project and in your future studies and careers.

Style and Approach

One of the things I want to explore this semester is design and the design process: how do we make something that other people find useful? To answer this question for a programming language, we’ll take a studio design approach.

In our studio, all work in progress is made public [John Seely Brown]. Assignments, critiques, grading, and projects will be viewable by everyone in the class, all the time. Much of our work will be to comment on, critique, improve upon, and be improved by one another.

Resources

Scala: During the first half of the semester, we’ll be programming in Scala. Scala is installed on the College’s and CS Department’s computers; but if you have your own machine, you’ll probably want to install Scala on it. I’ll provide some extra information on the Scala tools we’ll use during the third week of class. There are lots of good online resources for learning Scala.

Books: There are three recommended books for the course. You don’t need to buy any of them; but I recommend them because the each give the most bang for the buck in this class.

  • Scala for the Impatient by Cay Horstmann. This book is a good reference for the Scala programming language, which we’ll be using a lot during the first half of the course. I’ll point out parts of the book that might be useful for particular assignments.
  • The Design of Everyday Things by Donald A. Norman This classic design book is mainly about the design of physical objects, but many of the principles can be transferred to the design of programming languages (and other software). It’s a great read, and it will probably change the way you look at the world.
  • Language Implementation Patterns by Terence Parr. This book is a great, general resource for implementing programming languages. It will be most useful to you during the second half of the course, as you work on your project. I won’t give any assigned readings, but I might point you to parts of the book that I think will help with your project.

Forum: We’ll have a discussion forum, where we can ask questions about the course and where I’ll post announcements. You’re required to keep up with announcements on the forum. At the start of the semester, we’ll decide as a class whether we want to use Piazza or Slack for our forum.

GitHub repository: All the assignments and course notes will live on GitHub, where we’ll also comment on and critique each other’s work.

Feedback

Feedback is an important part of any learning. During this course I will be asking you to give me feedback on your learning in implicit ways (e.g., exercises and assignments) as well as explicit ways (e.g., “How’s the class going for you?”). This is your class, and I want to make sure you get the most out of it. Please let me know right away when something we discuss is not clear. If you don’t understand something, chances are that several other students feel the same way. You are always free to interrupt me — don’t let me get away with glossing over any topic. I also welcome any feedback about the structure, tone, and nature of this course. I ask that you give me this kind of feedback outside of class — either in office hours or via email. If you would like to give me anonymous feedback, you can send anonymous email.

Collaboration and the Honor Code

This course is highly collaborative. There will also be a few times when you should complete work on your own. You should conduct yourself in accordance with the Harvey Mudd Honor Code and with the Computer Science Department’s academic honesty policy. If you have any questions, please ask me.

Even though everyone else’s work (and often, the solution) will be available at all times, you must do your own work. You can be inspired by others, but you should look at someone else’s work only after doing your own work. If you are inspired by someone else’s solution, you can incorporate into your own, with attribution. Use your good judgement here. If you have any questions about what’s acceptable, come talk with me about it.

Coursework and Grading

Your grade in this course will be a combination of:

  • Assignments (40%). There will be roughly one assignment per week for the first six weeks (after that, you’ll be working on your projects). The assignments will be reading+writing or programming. Some assignments you will complete on your own; some you may do in a team. Every assignment will have a “critique” component, where you help evaluate someone else’s work. Assignments will typically be given out on Wednesday, with the submission due the subsequent Sunday and the critque due on Tuesday.
  • Project (40%). You will complete one large project that asks you to design, implement, and evaluate your own domain-specific language. Though the project is due at the end of the semester, I will provide milestones and guidelines throughout the semester, to help you stay on track. I’ll be handing out lots more details — including expectations, grading criteria, and project suggestions — when the time comes, about three weeks into the semester.
  • Participation (20%). A course like this one benefits from lively debate and from our diversity of experience and interests. There often is no right answer to a problem, so I expect that you will contribute your opinions and reasoning both in and out of class, especially through critiques. I also expect that you will share your interests: Do you know of an interesting domain or have you found a cool DSL? Let us know! During class, I will set aside times for us to discuss these things. You can also post them to the class forum. Participation is a naturally subjective quality, though it can be measured. I will measure your participation in part by assigning small thinking/writing exercises during class, asking for feedback on assignments, and observing your interactions with classmates. Half-way through the semester, I will ask you to assess your level of participation. I will compare my assessment to yours, and if there is a discrepancy, we will work it out. Rest assured, I want you to succeed. If you are concerned about your level of participation or how I might perceive it, please visit with me.

Notices

Social Engagement

The mission of Harvey Mudd College is to prepare leaders who understand the impact of their work on society. Our institution is a vibrant part of that society, and we might be affected by the violence in our world and the tumult of this political season. Social justice demonstrations are likely to occur at the Claremont Colleges this year, and we understand that some students may wish to take part in these activities. Therefore, we are willing to accommodate your reasonable participation in such events, so long as you coordinate with your instructor in advance, ideally at least 24 hours before the affected class meeting time or due date.

Writing Center

The Writing Center provides a welcoming space for writers to get feedback on their composition projects, whether written, spoken or visual pieces. Writing Center Consultants are prepared to assist students in any discipline with any stage of the writing process, from developing an idea to polishing a final draft. Even the most accomplished writers benefit from seeking feedback at the writing center. The center is open Sunday through Thursday evenings from 7-11 and Saturday and Sunday afternoons from 3-5. It is located in Shanahan 1470, just up the walkway from the cafe. You may schedule an appointment through their website, or you may simply drop in during normal hours.  If you’d like an appointment outside of normal hours, you may email writing_center@hmc.edu with your request. You will likely find your writing center visit more valuable if you go earlier than the night before your final draft is due.

Accommodations

To request academic accommodations due to a disability, HMC students should contact Heidi Bird our Coordinator of Student Support. For students from the other Claremont Colleges, please contact your home college’s disability officer: