Monday, May 24, 2010

Learn to Program in
Scheme 1, Getting Started


This is the first post in
a new blog that is all about
scheme programming. Scheme,
as I understand it, is a subset
of Lisp, another programming language.

I'm not an expert in Scheme programming.
In fact, I'm learning the language
myself as I write.

Why am I learning Scheme? Because it
is a way to extend the Gimp, an image
editor. Gimp extensions are written
in Scheme.

In Gimp, you do most things by hand.
For example, lets say that we wish
to resize an image. Let's say we
wish to resize all images that are
more than 900 pixels wide to be just
900 pixels wide.

Of course, we can do this in Gimp
by resizing the images by hand. That
is to say, we can work with Gimp to
resize these images interactively.

Lets now say that we have one thousand
images we would like to resize. Doing
so interactively then becomes tedious
and error-prone.

This is where Scheme comes in. In Gimp,
you can use Scheme to resize the images
for you. That is to say, Gimp will load
the image, check to see if it is over 900
pixels wide. If it is over 900 pixels wide,
Gimp will scale it down to 900 pixels.

However, Gimp will not do this unless you
program Gimp to do it. To program Gimp,
you need a programming language. The
original language for doing such things
in Gimp is Scheme.

There are other languages you can use to
program Gimp. Python is becoming a more
and more viable option to Scheme if you
wish to program Gimp. However, as I write
in May of 2010, Scheme is still the most
popular way to do this. Also, Scheme
has been around the longest and is the
original scripting solution for Gimp.

Ed Abbott

No comments:

Post a Comment