The undergraduate language course: what to do?

Thinking about teaching our undergraduate PL next semester, I've been digging up lots of suddenly interesting readings. The teaching about PL project links to much information, and Wadler's and Felleisen et al.'s critiques of SICP were enlightening as well.

Most recently I stumbled upon Joseph Bergin's writings on teaching, in particular ""The undergraduate language course: what to do?" (SIGPLAN Notices 36(6):20-22, 2001), which describes a taxonomy of course approaches: "historical", "smorgasbord", "interpreter", and "principles". Also relevant is a recent article "In Computer Science, A Growing Gender Gap: Women Shunning a Field Once Seen as Welcoming" by Marcella Bombardieri (Boston Globe 2005-12-18).

(I'm sorry I couldn't find Wadler's and Bergin's articles freely available online.)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Critiques of SICP

Heh, I just thought, Wadler's is simply the most effective critique at all, to not publish it freely at all.

Of course that means most people won't ever read it...

I'm not sure how to think of the Felleisen et al. paper, either. It looks a bit like an advertisement for their own book, which is fine, but not really the best source to make a neutral decision. But they make some good points.

I for one like SICP. In Germany it's the best undergrad thing I've seen so far. Most students who went through the course had only one problem: they didn't get it. But many also don't get Java. I can hardly blame the SICP book for the shortcomings of students' attention in class or at home.

I don't want to read all the other links you mention, but let me say that I've also seen some good introductory courses done in SML or Haskell. Often the structures encountered there were more complex (and thus more interesting) than those in comparable Scheme courses, because of the more compact syntax and because the type systems make for some interesting exercises as well, and force students to reason formally about program structure.

OTOH Lisp syntax is IMHO an important thing to get across, so that students can make an informed judgement of stuff like XML. Of course they should also have knowledge about OSes and file systems, to make informed judgements about modern databases and application servers.

I don't think anything should be done about women in engineering disciplines. Let them choose. If they choose lower-paid jobs in other areas, well, their choice. I wouldn't like to work in most fields (like physics, chemistry, electrical engineering ...), so I can hardly blame them. For people who don't already have any strong professional preference, the existence of a better job situation for most CS guys should be incentive enough. Also, most CS students I know aren't all that geeky anymore, so the people factor shouldn't turn anybody off.

I think your attitude that wo

I think your attitude that women chose there suffering is verry naive, and offensiv, but this might not be the right time and place to discuss feminist theory.

Please not smorgasbord

I recently took my undergrad PL course, and my Prof. did it as far as I can tell, in the smorgasbord style. He was a good guy, and a good teacher, but the style of the course (wide breadth, shallow depth) left me feeling very under-satisfied. I felt like I didn't get to learn a whole a lot about anything. I personally would have prefered an interpreter style course.

Good question!

I remember reading Bergin's article when I was designing the course I teach. I decided on EOPL, so you can count me in the "interpreter" camp.

I distilled Bergin's classification down to two fundamental choices: "survey" courses that present several languages (i.e., historical and smorgasbord) and "essentials" courses that cover languages from a more language construct and semantics approach (i.e., interpreters and principles).

I think students don't really understand the concepts and intricacies involved until they implement the interpreters (even reading the code of the interpreters isn't enough, you need to modify them in order to learn). Perhaps this is of such importance in my case because I teach at a distance learning university, but I think the issue is universal.

It is quite easy to present interesting languages and historical lessons you find instructive during an "interpreter" course. You can do it during the lectures (I mention Haskell quite a bit, even though EOPL is Scheme based). You can also assign students essay exercises (say two during the semester) in which they have to examine and present an interesting language or construct.

So I'd go for an interpreter course, and add additions on the side.

Finally, let say that the most important thing is for you to choose a style of presentation you enjoy and find instructive. Students instinctively appreciate that.

What about at the graduate level?

I teach a graduate level course, and as far as I can tell, my approach there is... to use all 4 styles! [They are grad students, I am allowed to make them work hard]

I usually teach 2-3 classes in the historical style, with the first class being 100% history. Then I switch to the lambda calculus and types [using TAPL], then move on to operational, denotational and axiomatic semantics [drawing in part from TAPL, in part from a colleagues lecture notes for an undergrad course, I just go through it a lot faster]. For semantics, I go out of my way to present parts of semantics for imperative, functional and OO fragments. I only did operational semantics of Prolog the one year, it is usually too hard to get to there.

However, the assignments bring in new dimensions: the first assignment is always a "do you understand genericity" assignmnet [example: code a generic quicksort which works over any orderable data type, with any ordering function, and with an arbitrary pivot selection algorithm]. That's the easy part - the hard part is that this assignment is to be done in an imperative, an OO, a functional and a logic language.

The second assignment asks them to implement a lambda-calculus interpreter for a subset of the lambda calculus, but starting from an AST [I don't want them to die in the details of parsing, that's not my point]. I make the assignment clearly under-specified (by not saying what to do regarding 'stuck' states, polymorphism, etc). And this assignment is also to be done in 4 languages (imperative, OO, functional, logic), but with 4 *new* languages. Here I usually go out of my way to expose them to languages they ought to know if I have not assigned them before [I rotate the languages from year to year], so I make sure that Ocaml, Haskell, Mozart/Oz, Mercury, and Scala show up.

The third assignment is to write a type inference algorithm for their lambda-calculus. Here, I specify the assignment more tightly, as it is already challenging enough. I ask the students to change 2 of their implementation languages (from assignment 2), and keep 2 - they make a proposal, I review.

The fourth assignment covers 'scripting languages', as well as working hard to get them to think of libraries, re-use, etc. Last year the assignment was to [query Google to get 100 C files, download these, compile them via gcc with all warnings turned on, collect statistics on the results, and display them; do in in

I also get the students to teach at least on class each, with material that will be on the final exam.

Too hard...

I like to give complicated exercises, but it seems to me that perhaps you expect too much. I think it would be better to have one major goal for each exercise. I wouldn't normally ask students to write the type inferencer, for example, in two languages.

The students seem to be able to handle it

Basically, after the first assignment, they get a decent understanding of how to do a paradigm-independent design, which is reinforced by the second assignment. So by the third assignment, they have understood this well enough that it actually becomes just a transcription exercise. And it is also the only that I know to force students to really learn about the paradigms. At least, 2/3 of the class deals with it just fine. Also, I give them a link to the code from TAPL with a type inference engine written in Ocaml (and thus I disallow Ocaml for that assignment).

Also, I make sure all my assignments have solutions with 1000 line monsters.

Wadler's critique online.

The miranda homepage seems to have the Wadler critique online.

OT: Miranda

Nice to see that Miranda is now available for download online.