The Only Features I Need

Posted

This post is a sequel to earlier ones about the Lox programming language and empirical design of a language that’s no larger than necessary.

I’ve implemented the examples from Software Tools in JavaScript, and I think that doing them twice has given me a decent perspective on what features a programming language needs to have in order to be a sturdy platform for teaching software design:

This list is obviously incomplete: for example, I haven’t specified what operations I want for lists and dicts, whether it should be possible to define default values for functions’ arguments, what kinds of classes I want, and so on. But here’s the thing: I think we can answer these questions empirically. As I said last year, I think we could go through a dozen books on software design (or some data structures & algorithms textbooks), tally up what’s used, and then design a language that includes only the top N features. It would result in a very conservative language, but I think that’s what we want for teaching: something that introduces people to the things they’re most likely to encounter no matter what language they use next. If you have a student looking for a project, please give me a shout.