University courses using Gtk2Hs for teaching

Starting this academic term, Gtk2Hs is being used as part of teaching functional programming on two different University courses, one at the University of Oxford in the UK and one at the University of Jyväskylä in Finland.

The Oxford course

The practical element of the Oxford Functional Programming course is short project about L-Systems and uses a GUI written using Gtk2Hs to display the results and adjust the L-System parameters.
The students are given the GUI module so they do not have to write it themselves. Previous practicals that involved graphical interfaces used a solution that involved having the Haskell program emit output over a pipe to a GUI written in Tcl/Tk. This rather gave the impression to the students that Haskell was just a “toy” language since apparently it was not suitable for building graphical interfaces. The new solution using Gtk2Hs no longer gives that impression since it is written in Haskell and a more modern visual appearance than the Tcl/Tk interface. It is also considerable simpler than the Tcl/Tk solution; the GUI module is only 150 lines long.

Unfortunately the practical material is not available outside of the domain.

The Jyväskylä course

The Jyväskylä Functional Programming course course uses graphics and animation in examples, exercises and practicals. It uses an implementation of the graphics API presented in the “Haskell School of Expression” book. This is a new implementation of the SOE graphics API based on Gtk2Hs rather than the original implementation which used the HGL. This new implementation is available via darcs here. The version used on this course is a back-port to Gtk2Hs 0.9.8.

Antti-Juhani Kaijanaho, the designer of the course, decided to use Gtk2Hs because he wanted it to work on both Windows and Linux (the HGL implementation of SOE is currently out of order on Windows) and because he wanted to use graphics in examples and exercises without having to spend too much time to learn the graphics API (the JyuGraphics.hs is less than 500 lines of code).

The materials for this course are available in Finnish (lectures, exercises, practical).

Comments are closed.