[Haskell-cafe] Functional programming for processing of large raster images

oleg at pobox.com oleg at pobox.com
Wed Jun 21 02:00:26 EDT 2006


Recently Vo Minh Thu wondered if Haskell (or, I generalize, functional
programming) can be of much use for computer graphics programming.

I'd like to point out a project that experimentally shown that
functional programming is of great help for processing of large raster
images (24-bit PPM files). The paper describing the system has been
accepted for `Science of Computer Programming' and is in press:

  Combining Partial Evaluation and Staged Interpretation in the
  Implementation of Domain-Specific Languages
  Christoph A. Herrmann, Tobias Langhammer

The code for the system is available online
 http://infosun.fmi.uni-passau.de/cl/metaprog/imagefilter2-2005-10-30.tgz

The previous [slightly obsolete] version of the paper, 
presented at the MetaOCaml'04 workshop, is available online
	http://www.fmi.uni-passau.de/forschung/mip-berichte/MIP-0410.html

The paper includes a few pictures and the table with benchmark, so we
can observe the benefits. Now, with offshoring and native MetaOCaml
fully implemented, we can gain bigger benefits.

In this project, functional programming does what it is probably best
suited: to develop a `compiler' -- a compiler from a filter
specification to quite efficient code. The code is specialized to all
available static information. To be precise, the authors implement an
interpreter -- which is then specialized to the source program and so
interpretative overhead is removed and the code is optimized. Staging
an interpreter automatically gives a compiler. Futamura projections
are not only the fascinating, but useful, too.



More information about the Haskell-Cafe mailing list