Reprocessing as a first programming language?


I’m thinking about writing a (possibly interactive) book for beginning programmers, using Reprocessing as the language, and I would like your comments on the following.

First, I’m a big fan of Processing as a first programming language. It’s visually oriented, which makes it much more fun for students. (“Let’s write a program to make a circle move across the screen!” beats “Let’s write a program to calculate compound interest!” every time.)

One of Processing’s selling points as an introductory language is that you can start out by writing calls to graphics functions in their IDE, which ships with the language:

ellipse(50, 50, 80, 80);
rect(10, 10, 30, 20);

click the Run icon, and it Just Works; no extra setup necessary. Installing the language and the IDE is also fairly straightforward.

I think Reason would make a good introductory programming language, and I’d like to use Reprocessing as the vehicle for its graphics goodness. The problems, as I see them, are:

  • Installing ReasonML is non-trivial, and there isn’t a nice IDE like Processing’s. This could be overcome by having a web-based interactive book with “leaving the web environment” as a topic towards the middle or end of the book.
  • You need to know a lot of ReasonML constructs to write your first Reprocessing program. The example at uses labeled parameters, modules, ignored parameters (_state), and punning (~setup and ~draw). The last two of these could be avoided by returning unit from setup() and not doing the punning, but you get the idea.

What do you-all think?


Pardon the bad netiquette for responding to my own post, but I have some further thoughts. This is thinking off the top of my head, so it may not be too coherent.

  • ReasonML encourages functional programming, but the visual part of Processing is all about the side effects (output). If you want to emphasize FP, you have to shift the focus to Reprocessing as a way to transform the state from one frame to the next.
  • I think I have a narrative hook to explain the amount of setup (in terms of language features) that you need for Reprocessing. If I recall correctly – I don’t have my copy at hand right now – “The I Never Cooked Before Cookbook” has an introductory chapter on the cookware, utensils, and spices you absolutely need to have in your kitchen. That chapter comes before they give any recipes at all. Given the overused metaphor of an algorithm as a recipe, I think that will work nicely.