Installing Gambit Scheme
As I described in my previous post, I am a fan of the Gambit implementation of Scheme. While following these instructions, try to keep in mind that the Scheme community is smaller than the communities of the more major languages like Python or Ruby, so there are still rough edges that get in the way. I hope that my experiences can speed things up for other fledgling Schemers.
It is possible to install Gambit Scheme from the Ubuntu repositories. However, the repositories contain an older version, so I recommend building Gambit Scheme from source instead. First, go to the Gambit Scheme website.
Click on the “Sources” link and save the gambc-v4_1_0.tgz file to your home directory. Next, open up a terminal (Applications -> Accessories -> Terminal), and enter these commands:
tar -xzvf gambc-v4_1_0.tgz cd gambc-v4_1_0 ./configure && make make check sudo make install sudo make bootstrap cd /usr/bin sudo ln -s /usr/local/Gambit-C/current/bin/gsi gsi cd ~
Once the installation is complete, conduct a few tests. From your terminal, enter the command:
gsi
You should then see Gambit’s interactive interpreter prompt. Enter the following code:
(define numlist '(2 10 6)) (map (lambda (x) (* x x)) numlist)
You should receive these results:
Exit the interpreter, by pressing CTRL-D twice. You can also use the Gambit Scheme interpreter to run Scheme programs stored in files. As an example, put the following text into a file named hello.scm:
(display "Hello World!\n")
Run the file with the command:
gsi hello.scm
That should be enough to start experimenting with Scheme. Part 2 will describe the installation and use of the SLIB libraries.


the command should be:
“(include \”/usr/local/lib/slib/gambit.init\”)” > ~/.gambcini
^ was missing
Also, on my Firefox browser, the commands were just one long line all run together. If you make them look like this, they can be read and used:
tar -xzvf gambc-v4_1_0.tgz
cd gambc-v4_1_0
./configure && make
make check
sudo make install
sudo make bootstrap
cd /usr/bin
sudo ln -s /usr/local/Gambit-C/current/bin/gsi gsi
cd ~
Jim
Comment by Jim Entwisle — February 12, 2008 @ 3:51 am |
the damn thing re-formatted what I wrote. I was trying to say that the fullstop(period) was missing before the word `gambcini’ in the original command.
Jim
Comment by Jim Entwisle — February 12, 2008 @ 3:55 am |
Thanks for the info, Jim. It seems that some formatting was lost in my recent move from Blogger. Come to think of it, it seems there may be some missing images, too. I’ll have to go over all my posts carefully.
Comment by bnsmith — February 12, 2008 @ 1:47 pm |