1 Anticipated Frequent Questions

This AFQ (Anticipated Frequent Questions) should cover most of your questions.

Q: How do I keep on top of things, and where can I ask questions while the assignments are in progress?

Please use the Piazza board. You should use your Brown email address to access the board.

Be sure to not post hints or solutions publicly! Be aware of the Honesty and Sharing policy before you sign up.

Q: Are there any exams in this course?

No. I don’t believe exams are a useful way of measuring learning except inasmuch as they can be proctored to detect cheating (for which we have other mechanisms). In return, they are too dependent on test-taking ability, time preferences, not being ill on a particular day, personal constraints, etc. Therefore, this course has no exams, only Assignments.

Q: Why do you want anonymous submissions?

To the extent possible, we want to eliminate biases when grading. These may include biases both in favor or against people based on attributes such as race, gender, or even how they present themselves in person. To make clear we are serious, we will impose a small penalty if you do include personal identifying information (unless asked to).

I know this runs counter to what you have probably been told by countless prior instructors, and maybe even those in your other classes. If you’re turning in pieces of paper, it is important to label them clearly. Since your submissions here are electronic, that’s not a problem.

In case you’re wondering: yes, your identity is recorded when you submit. However, we run an anonymization script before distributing work for grading. Therefore, the graders only see an anonymous token (e.g., “103”) in place of your identity.

You may then wonder what happens when you go in for help after you get graded material back. Would that deanonymize you for the future, i.e., will that TA henceforth know who person 103 is? No, because the script randomly assigns different tokens on each use. Therefore, there’s no reason to believe person 103 from the previous assignment is the same as 103 on this one (in fact, there’s a very high likelihood it’s a different person).

Q: What is the course format?

In your day-to-day work, you are going to confront numerous programming languages: new ones are created almost daily, and you never know which new language will become really important in your work. You therefore need the ability to rapidly dive into new languages and understand them.

However, you haven’t really been exposed to a useful mental landscape that lets you quickly understand a new language. This usually comes through practice and experience, combined with a knowledge of various points in the space of language design.

The original style of cs173—used 2000 through 2015—was (we believe) good at helping you understand a few points in the design space really well. But it didn’t cover enough of the space, nor did it give you practice with rapidly exploring a large space of designs. In 2016 we came up with a radically new way of running the course that we found addressed this problem. However, we also felt something was lost in the original style, and this was echoed in student evaluations.

We had suspected this, but weren’t sure how much time the new style of assignments would take, and didn’t want to accidentally overburden students. Fortunately, the evaluations confirmed that the assignments took less time than we expected. Therefore, we have the time to merge the two styles (making some time for it by dropping or changing assignments).

Q: What did you do before 2016?

Until 2016, the emphasis was on implementing languages through so-called “definitional interpreters”: working implementations that created the core of a language. We still do this, but far less of it.

Q: What did you change in 2016?

The most important thing is to make you understand that approaching a new language requires a security mindset, and that’s what we want the course to inculcate. It won’t be about computer security per se, but it will be the mindset that comes with it: of probing, asking questions, looking for ways in which things might not fit together, etc.

We will achieve this through a series of what we call mystery language (ML) assignments. In an ML assignment, you are given a new language feature’s syntax and a very loose description of it. The assignment will contain (say) three different languages that contain that new feature, each presented in terms of a black-box implementation of that language. Each language will contain this new feature but will define it to behave in a somewhat different way. You will need to use the implementations to explore how the feature varies across the languages and try to pin down the differences precisely.

For instance, suppose the new feature is array dereference, and you’re given a notation for it such as a[i] where a evaluates to an array and i is an expression computing the array index. When i is within the bounds of the array, all three languages might behave identically. But when i is out-of-bounds, one language might signal an error (like Java does), another might return a special undefined value (like JavaScript does), and the third might return the content of some other array (like C sometimes does).

These differences have all been chosen because they have significant consequences, and the class after the homework comes due, we will discuss them. Note that in the above example, to find these differences, you needed to “think like an attacker”: ask what the arrays do not when you use them as intended but rather when you use them erroneously. Of course, many ML assignments have nothing to do with errors, but it is wise to remember that those are also worth checking.

In general, in ML assignments, your task is to:
  • Write a small suite of (one or more) programs, which we call a classifier, that tell the languages apart. That is, each program in the suite produces different outputs on at least two of the implementations, and across the suite, you can tell all three apart.

    Since these small programs are meant to be illustrative, it helps to make them relatively small. At the same time, you will not be rewarded by trying to cleverly wire them all together into a single program: that can sometimes be really hard to understand. If you spot two or three conceptual differences, try to express them in different programs. Imagine you’re trying to explain your findings to another human being, not just impress them with your cleverness.

  • Write a small textual description, the theory, of what you think is the difference between the languages, focusing on the new feature and its interaction with the existing features. This should not just be a textual rewriting of the classifier, but rather an attempt to synthesize what you’ve learned and describe the difference in high-level terms.

What we’re getting at is essentially the heart of the Scientific Method. You perform some observations; using these, you formulate an initial theory; you use the theory to suggest additional experiments. If an experiment fails, then you have to revise your theory and try again. As more experiments succeed, you gain greater and greater faith in your theory. At some point you conclude you’re sufficiently satisfied with your theory, you clean up your work, and you turn it in.

Q: Were there other issues you were trying to address in 2016?

Yes, there are a few things that also needed fixing:
  • The course was a little too helpful to cs017 students (and to a lesser extent, cs019 students), and disadvantaged cs015 students. Though we’ve tried various mitigations over the years, they have worked only somewhat. The use of mystery languages greatly reduces that advantage.

  • The course was a little too much focused on implementation, whereas that’s really the domain of a course on compilers. We wanted to reduce the emphasis on implementation of languages and increase the emphasis on understanding them.

Q: So the new style is a merger of the two approaches?

That’s correct. There will be a whole bunch of mystery languages. Now that we have a good understanding of how much time they take, we have also been able to put back in several implementation tasks. We will also implement some other tools to help you understand some patterns in programming language tools as well as in language expressive power.

Q: How much time will things take?

For the mystery languages, specifically: we ask that if you spend more than five hours on a homework, stop; talk to the course staff; make sure you’re on the right track. We may tell you you’re on the right track and to continue; we may tell you you’re on the wrong path and help set you right; or we may tell you you’ve gotten the point of the assignment and should stop.

For the other (implementation) assignments, your usual internal cues on programming apply.

Q: What are “Core”, “Advanced”, and “Prank”?

In the mystery language assignments, you may see the different languages labeled differently. Every assignment has (usually three) Core languages. These reflect the most common or important variations in these features. The array dereference example described above presents three such variations.

Sometimes, there are variations that have made it into real languages but are less important or harder to find. We label these Advanced. For instance, in array dereferencing, a negative index, instead of being an error, could mean “that many indices from the end of the array”. We would consider this an Advanced (but a somewhat straightforward one for people familiar with certain languages that have this behavior). Before you tackle any Advanceds, make sure you’ve nailed down the differences between the Cores! Also, be aware that the Advanceds may take a little or a lot more time than a core.

On very rare instances, an assignment might also have Prank languages. This is usually us re-implementing for you especially bizarre behaviors found in some language. You should only try to classify these languages if you’re really bored or really want to show off your language hacking skills. (Under no circumstances will we expect you to get any of them to get an A in the course.) As an example, there was once a bug in a well-known browser where dereferencing the index -6 would return the value of eval, a dangerous primitive that many Web sandboxes do their best to hide. If we were to provide an implementation of this, we’d certainly classify it as a Prank.

Q: I have a question not answered above! Where do I send it?

A: Address it to the professor.