Monday, August 25, 2008

Teaching programming

It occurred to me that I've never blogged about my work, so why don't I start...

My thesis work is centered around the use of a visual programming environment (VPE) to teach students new to computer programming how to construct software. This isn't a new idea of course, others have done so (Alice, Squeak, etc), however use of a VPE based upon the functional programming paradigm in educational settings is rather uncommon. The VPE I'm using is known as the Gem Cutter, which is a part of the OpenQuark framework originally developed at Business Objects.

To give a bit of background: OpenQuark is a framework which consists of a language called CAL which is a very Haskell-like language which compiles down to Java bytecode, and thus is interoperable with existing Java code. The Gem Cutter is a VPE which is built upon the CAL language (that is, all components or gems in the Gem Cutter correspond to CAL functions, or imported Java routines). Much more info can be found on the Wikipedia page on CAL and Quark, as well as the main homepage. It is similar in some ways to the Scala programming language, although Scala is intended as a language by itself (and compiles down to Java bytecode) whereas CAL is intended as a way to bring the functional paradigm to Java.

The reason that I find the Gem Cutter interesting is because typically I've found VPE's counterintuitive, not particularly useful, or "dumbed-down". For example, I've always found Alice a bit hard to take seriously (to be fair it has been designed to be friendly to younger audiences) due to the emphasis on kid-like "toy" animations rather than general programming constructs.

The Gem Cutter OTOH is a tool designed for and made by professional software developers working at a major software company. In particular, the functional paradigm seems particularly well suited to this, as (like dataflow programming) it has a natural visual mapping of having functions (or "gems" in Gem Cutter terminology) composed together with outputs of one feeding into the inputs (or arguments) to another. So rather than seemingly bending the paradigm to fit the visual model, it seems to be a much more natural fit.

Now you're probably thinking I'm overselling Gem Cutter, and I am. There are warts on it. Numerous times while working with it I've run into bugs, or "gotchas". Part of my thesis will be the exposition of these issues from the perspective of one trying to use the tool in a learning environment. Having said that however, it really is a cool piece of software to play around with, and in particular if you're a Java developer who's ever had the desire to pass around higher order functions then I highly recommend checking it all out. And more imporantly, it's all open source released under a BSD-like license so you can do pretty well whatever you want with it.

No comments: