My new programming languages course

tl;dr: my new PL course is now finished, and all the course materials are freely available. Working through all the exercises should be a great option for anyone wishing to learn some basics of programming language design and implementation.

Last May, I wrote about my ideas for designing a new PL course, and got a lot of great comments and feedback. Well, somehow I survived the semester, and the course is now over. In the end I’m pretty happy with how it went (though of course there are always things that can be improved next time).

I decided to use class time in an unconventional way: for each class meeting I created a “module”, consisting of a literate Haskell file with some example code, explanatory text, and lots of holes where students needed to write answers to exercises or fill in code. I split the students into groups, and they spent class time just working through the module. Instead of standing at the front lecturing, I just wandered around watching them work and answering questions. It took a bit of getting used to—for the first few classes I couldn’t shake the feeling that I wasn’t really doing my job—but it quickly became clear that the students were really learning and engaging with the material in a way that they would not have been able to if I had just lectured.

A happy byproduct of this approach is that the modules are fairly self-contained and can now be used by anyone to learn the material. Reading through all the modules and working through the exercises should be a great option for anyone wishing to learn some basics of programming language design and implementation. For example, I know I will probably reuse it to get summer research students up to speed. Note that the course assumes no knowledge of Haskell (so those familiar with Haskell can safely skip the first few modules), but introduces just enough to get where I want to go.

I don’t plan to release any solutions, so don’t ask. But other than that, questions, comments, bug reports, etc. are welcome!

Advertisements

About Brent

Assistant Professor of Computer Science at Hendrix College. Functional programmer, mathematician, teacher, pianist, follower of Jesus.
This entry was posted in teaching and tagged , , , . Bookmark the permalink.

9 Responses to My new programming languages course

  1. Max says:

    “Find the ghci command to reload the current module. Uncomment the line i = 12 above, save this file, and reload. What happens? Does it change your answer to the previous question at all?”

    The previous question is about ->; this seems like it should refer to the question before that, about =.

  2. Russ Abbott says:

    I thought I left a comment with a number of questions a while ago, but I don’t see it. Perhaps I forgot to click “Post Comment?”

    First of all it sounds like a great course. I hope to use it next Fall when I teach our FP in Haskell course again.

    I am concerned, though, about the difficulty of the material. How did the students do who came to the course without your earlier Haskell course?

    In looking through the material I didn’t see any discussion of grading. How do you grade students — especially if they do most of the work in groups? Just so you know my preference, I have students explain their work to me. If the work is right and based on their explanation I’m convinced that they understand it (and didn’t just copy it from another student of elsewhere), they get credit for the assignment. A student who gets credit for all assignments gets and A in the course, even if they achieve understanding only after talking to me a few times.

    Thanks for your comments — and for your work in developing this course.

    • Brent says:

      Hi Russ, thanks for the comments and questions!

      The students who came to my course without earlier Haskell experience did fine. It probably helped that they were generally paired with students who had prior Haskell experience, but it’s hard to say how much it helped. I would without hesitation still do this with a class full of students with no Haskell experience, but I might stick in another module or assignment to give them a bit more practice. But I tried to design the modules so that they very carefully guide students through exactly what they need to know in order to complete the rest of the class (note it is actually a fairly small subset of Haskell that ends up getting covered — for example, no type classes).

      I graded students based on their submitted modules and projects. The modules themselves I treated mostly as learning opportunities, and graded them rather leniently — typically I would just grade them based on completeness, not correctness. I would give a lot of feedback, however. Most of the assessment happened on the projects, which had to be completed by the students individually, and for which I had more extensive grading rubrics based on correctness, style, and so forth. In any case, I think your mastery-based grading scheme would work well with the material.

      I have to say it is *not* really a course about FP, so I’m not sure how you intend to use it in an FP course. But of course you’re welcome to use it however you like, and I’d be interested to hear about if and how you do end up using it.

      • Russ Abbott says:

        Thanks Brent. I hadn’t realized that the course doesn’t cover type classes.

        I was surprised by your final paragraph saying the course isn’t about FP. I looked back at the course description and see that it’s about programming language design. You cover a lot of ground, but do you really expect students to come out of the course able to talk about the advantages and disadvantages of, say, Go,vs. Prolog vs. JavaScript vs Haskel vs C#? That would be quite ambitious and I wouldn’t expect the course to do that. Are you familiar with ANTLR and it’s approach to DMS development? Seems like quite different aims. In any event, the course content certainly seems worthwhile.

        One final question. In the course material you say you don’t like Learn You a Haskell. Why is that? I found it a friendly and useful book for introducing students to Haskell. What are your disagreements with its approach?

        • Brent says:

          No, I certainly don’t expect them to be able to talk about the advantages and disadvantages of various real programming languages! I don’t really think there’s any way to do that in a semester. I want them to come out of the course knowing a bit about important ideas and techniques in language design. Some of that might well translate to better insight into existing languages. But it will also help them as they develop APIs and DSLs and so on.

          I know vaguely what ANTLR is but I am not familiar with its approach to DSL development, I will look into it.

          LYAH is certainly friendly but I have strong pedagogical disagreements with the order in which it presents material. For example, it jumps straight into processing lists using various partial functions without ever talking about data types or pattern-matching. To be honest it has been a while since I have looked at it and I don’t remember all the details of my disagreements.

  3. Russ Abbott says:

    Should have been DSL rather than DMS. Sorry.

  4. Brent, I have a few questions.

    Is your course a required course or elective course in your curriculum?
    … My experience is that teaching a class full of “conscripts” is considerably more difficult than a class of “volunteers”.

    How many students did you have?
    … My class in Fall 2016 had 55 students, which seems qualitatively different from my elective classes with 10-30 students. What works for the latter does not always seem to work for the former.

    Did you hold it in a room equipped for group work (active learning)? In a computer lab?
    ,,, My class in Fall 2016 was in a traditional classroom.

    Did you have to deal with student’s complaining about the use of what they considered an “irrelevant” language?
    … One year, I used Haskell for two-thirds of the semester and Lua for one third and had many students dissatisfied with Haskell. Next time, I used Lua for the first two-thirds (with emphasis on interpreter implementation) and had many students dissatisfied with Lua. I intended to use Haskell for the remainder, but I decided to switch to Elm in mid-semester.

    As I look toward teaching the course again next Fall semester, which will likely have a similar number of students and be in the same classroom, I am trying to decide what direction to go.

    • Brent says:

      Hi Conrad,

      The course is an elective course. I agree that teaching a required course tends to be more difficult than teaching an elective. It was quite small: only 6 students. It may be slightly larger the next time around, but I am at a very small institution (we have 1400 undergraudates total, and only about 10 computer science majors per year). Yes, 55 students is qualitatively very different than 10-30, although I think this kind of group active learning approach can work with either size.

      I did not hold the course in an active learning classroom (unfortunately we do not have any of those), nor in a computer lab. The students all have their own laptops that they brought to class. For groups of two sitting side-by-side is fine; for three it can work; but for groups of size 4 one would really need classroom space specifically set up for it.

      I have never had students complain about the use of an “irrelevant” language. I think this is due to several factors: it is an elective, of course; since it is a more upper-level course it is also easier to see that the language actually is relevant; and I think my enthusiasm is contagious to an extent.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s