Scheme on Ubuntu (with Chickens!)

My plan is to use Scheme for a game. Why? It’s an awesome language. And someone has to do it. This is my log/HOWTO that explains how to install it. I’m using Ubuntu 10.4 Lucid Lynx

Step one: Install chicken, a scheme interpreter/compiler, and gcc.

$ sudo apt-get install chicken-bin gcc

Step two: You are done.

$ csi

CHICKEN
©2008-2009 The Chicken Team
©2000-2007 Felix L. Winkelmann
Version 4.2.0
linux-unix-gnu-x86 [ manyargs dload ptables applyhook ]
compiled 2009-11-30 on vernadsky (Linux)

#;1> (print (cons “Hello” “World”))
(Hello . World)

This is the interpreter, but we want to build executable files. The compiler, csc, does this for us.

$ cat > hello.scm
(print (cons “Hello” “World”))

$ ls -l hello
-rwxr-xr-x 1 erehling erehling 18845 2010-04-21 18:11 hello

$ file hello
hello: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped

$ ./hello
(Hello . World)

Notice that we’ve got a real executable now – nothing’s interpreted. This is promising!

Next time we’ll draw some graphics.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.