Skip to content

Installing Chicken Scheme on Debian 12

Chicken Scheme is a practical and portable implementation of the Scheme programming language. This guide walks you through installing Chicken Scheme on Debian 12, creating a Scheme file, and running it.

Prerequisites

Before installing Chicken Scheme, update your system:

sudo apt update && sudo apt upgrade -y

Installing Chicken Scheme

Chicken Scheme is available in the Debian repositories and can be installed using apt:

sudo apt install -y chicken-bin

Once installed, verify the installation:

csi -version

If the installation is successful, you should see output similar to:

CHICKEN Scheme version 5.x.x (rev XXXXXX)

Creating and Running a Scheme File

  1. Create a Scheme file:
    Use a text editor to create a file, e.g., hello.scm:
nano hello.scm
  1. Write Scheme code:
    Add the following simple Scheme program to print "Hello, World!":
(display "Hello, World!")
(newline)

Save the file (CTRL + X, then Y, then ENTER).

  1. Run the Scheme script:
    Use csi (Chicken Scheme Interpreter) to execute the file:
csi -s hello.scm

This should output:

Hello, World!

Running Chicken Scheme in Interactive Mode

To start an interactive Chicken Scheme REPL, simply run:

csi

This opens an interactive prompt where you can enter Scheme expressions:

#;1> (+ 2 3)
5

To exit, type:

#;2> (exit)

Uninstalling Chicken Scheme

If you want to remove Chicken Scheme, run:

sudo apt remove --purge -y chicken-bin