Syllabus: Domain Specific Languages — Fall, 2011

  • Course title: Domain Specific Languages
  • Course code: CSCI 181B HM1
  • Professor: Ben Wiedermann
  • Pre-requisites: CS 70
  • Credit hours: 3

Table of Contents

  1. About This Course
  2. What You'll Need
  3. Coursework and Grading
  4. Feedback
  5. Collaboration and the Honor Code
  6. Notices

Updated September 2, 2011, to include more Scala resources

Updated October 4, 2011, to provide links to the project requirements.

About This Course

Description

This course explores a surprising concept: programming as language design. Good programming practice advises us to factor a common operation into a separate function or method, to be invoked whenever that operation is needed. A domain-specific language (DSL) takes this idea one step further by factoring several common operations into their own programming language. Examples include LaTeX, Kodu, and SQL.

This course systematically investigates why and how a programmer might create a domain-specific language. Along the way, we will write programs in many different languages for many different domains. The course will conclude with a project that asks you to design and implement your own domain-specific language. You'll never look at programming the same way again!

Learning Objectives

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

Because DSLs are a powerful and flexible programming tool, we will explore the topic systematically and thoroughly, 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

There are a near-infinite number of domain-specific languages. We're not going to study them all. We're not really going to study the languages per se. Instead we'll study a certain set of principles and techniques for designing and implementing languages.

Language design and implementation is both art and science; temperament and technique. The best way to learn it is by doing it. So, we're going to be doing a lot of programming. Sometimes we'll spend quite a bit of time investigating a single domain. The idea is that you'll know the principles we explore in your bones. By the end of the course, you will have implemented enough concepts, using a variety of techniques, that you'll have built up an intuition for language design and implementation that should serve you well in your future work. The process will be exhaustive and perhaps exhausting.

We're going to cover diverse topics, and the students in the class have a diverse set of previous experiences. As a result, at some point during the semester, it's almost certain that:

Your curiosity is your most important trait in this course. It'll be challenging at times, but above all I hope it'll be fun. There's lots of room to be creative, to show off, to take risks, and to learn new things.

What You'll Need

Resources

Scala. We'll be doing most of our coursework in Scala. Scala is installed on knuth, but you'll probably want to install Scala on your own machine. For the sake of uniformity, be sure to install version 2.8 or later. There a lots of good resources for learning Scala on the Scala website.

Books. There are no required books for this course, but there are a few books that I recommend.

These books will be especially useful in the first several weeks, as we gain experience programming in Scala:

The following books are useful as references (i.e., to look up particular topics, rather than to read cover-to-cover). You'll find them most useful in the second half of the semeseter, as you begin working on your projects:

* I will place a copy of the starred books in B102, for reference, since these will probably be the most useful to you.

Communication

I will communicate information to you through the course website and mailing list: cs-181b-l@hmc.edu. If you are enrolled in the class, you should have been automatically added to the list. You are responsible for checking the website and making sure that you are receiving mail that is sent to the mailing list. You should check your mail at least once a day, to keep up to date on the latest course announcements.

The mailing list is also where you can ask questions of your fellow students. In particular, as we learn Scala, you may need timely answers to programming questions. Your fellow students may be the best resource for this. When writing to the mailing list, be sure not to include information that violates the collaboration policy.

I will schedule regular office hours after the start of the semester. I also encourage you to come talk with me any time my door is open, which it will be whenever I am in my office and not in a meeting. You can also email me to schedule a specific meeting time.

Coursework and Grading

Your grade in this course will be a combination of:

Lateness policy

For homeworks, you have a total of four, 24-hour extensions. You can use at most two extensions for any given assignment. You do not need to let me know you are using the extensions; I will automatically apply them to any late work. Please keep track of how many extensions you have used, and if you're unsure, please ask me. I don't want you to lose credit for using an extension you don't actually have. There are no extensions for the project deadlines.

Extenuating circumstances (such as illness) are dealt with on a case-by-case basis. In general, you are only excused for situations you could not have foreseen, and only if you explain the situation at your soonest opportunity (either directly or via someone else, such as the Dean of Students), before the due date. If an extenuating circumstance will affect your work on the project, you must let me know as soon as you learn about it.

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., quizzes 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

I expect you to abide by the Harvey Mudd Honor code (see page 17 of the student handbook). All assignment solutions, code, and project materials should be produced by you alone, or by you and a partner, where appropriate. You may discuss algorithms at a high level with any student in the class. You may also help any student find a small bug in their code. However, you may not copy solutions from anyone, nor should you collaborate beyond high-level discussions with anyone who is not your partner. I encourage you to help one another, especially when learning Scala, but be sure to ask and answer questions in a way that does not provide solutions to the homework problems.

If you have any questions about what behavior is acceptable, it is your responsibility to come see me before you engage in this behavior. I am more than happy to answer any questions you may have.

Notices

Writing Center

The Writing Center provides a good opportunity for you to get feedback on your project write-up and presentation. This is a resource that can be helpful to all writers, from novices to experts, on all kinds of writing. The center is open Sunday through Thursday evenings from 7-11 and Saturday afternoons from 3-5. It is located in Parsons 161 in the basement just off the Galileo foyer. 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 them with your request. You are likely to find your writing center visit more valuable if you come earlier than the night before your final draft is due.

Acknowledgments

Thank you to Melissa O'Neill for her policy on extenuating circumstances, which I have adapted and included. Thank you to the HMC CS faculty for their collaboration and honor code policy, which I have adapted and included.