5 languages for teaching

Rosetta Code is asking for 3-5 languages for teaching orthogonal paradigms. I’ll bite (warning, I’ve spent all of about 15 minutes thinking about this list):

  • Standard ML (or OCaml, if more practicality is desired): functional programming and strong typing, in the simplicity of a H-M type system. Haskell and Scala’s type system extensions are fun, but pedagogically it seems useful to teach in a simpler environment first.
  • Forth, or perhaps Factor: stack-based programming has similar underpinnings to functional programming while feeling wildly different. And preparing the class would be an excuse to more deeply understand Forth. In the historical spirit of Forth, we’d learn it by building it, so some assembly and machine architecture (likely ARM) would be included as well.
  • Java: a “standard" object-oriented language, industrial-strength programming environment. Imperative programming. Design patterns.
  • JavaScript: dynamic language with prototype-based objects. Of the languages I’ve worked with, JavaScript seems to most deeply embody what it means to be a dynamic language without letting you rewrite the language from the inside. There are limitations, to be sure; you can’t make e.g. builder DSLs in it. But at its core, it takes well-worn PL concepts (objects, closures, etc.) and makes them thoroughly dynamic.
  • Oz: declarative programming, dataflow concurrency, and the wonders of having unification as a language primitive.

There are a number of languages I wish I could include (Common Lisp, Haskell, and C, to name a few). This list also has a heavily abstract-programming/virtual machine slant, with the exception of Forth; there isn’t much that runs close to metal, or even exposes the C/POSIX layer very much. That is, I will admit, a weakness. If I were to add a 6th language, it would probably be C or Perl, to get at procedural programming in a Unix-like environment.