Getting your Emacs/Slime-based Lisp programming environment up and running for CPS305 - ON YOUR PERSONAL COMPUTER
Published on Sept 05, 2024 by Marcus Santos.
“Lisp is the red pill.” — John Fraser
Introduction
The Lisp programming environment has already been installed and configured on all lab computers. If you want to install it on your personal computer, follow the instructions below.
The Lisp programming environment consists of the following components:
- text editor (Emacs); you may be tempted to use another text editor but I strongly encourage you to use emacs. However, if you insist on using another editor, I advise you choose it carefully. Stay away from program text editors that do not perform automatic parenthesis matching; it is virtually impossible to write lisp code without it;
- the Steel Bank Common Lisp (SBCL) compiler;
- package management (Quicklisp); and
- CodeGrader, a software application for assessing lisp program correctness.
SBCL, Emacs, and Quicklisp Installation
- First and foremost, you will need to understand how to run simple commands on a Linux or Mac terminal window. Navigate to https://marcus3santos.github.io/linux-terminal-101.html and complete the short tutorial on what the Terminal is and how to run commands on it.
- Please navigate to https://github.com/susam/emacs4cl and carefully proceed with steps 1 to 6 (inclusive) outlined in the Get Started section. These steps will guide you through the process of installing Emacs, SBCL, and Quicklisp.
Installation of CodeGrader
Type the commands below on a shell terminal to install CodeGrader:
cd ~/quicklisp/local-projects
git clone https://github.com/marcus3santos/codegrader.git
Configuring SBCL
Using a program text editor, open the following file located on your home directory
~/.sbclrc
then copy-paste and save the code below at the bottom of the program already in
~/.sbclrc
(ql:quickload :rutils) (ql:quickload :codegrader)
- Quit Emacs, open it again, then press M-x (i.e., press and release Esc, then press and release x) and type slime and press Enter. Emacs/Slime will then load the new configuration and program utilities.
In the Lisp buffer, type the following command:
CL-USER> (cg:eval-solutions "" :Lab01)
If you have properly installed and configured Emacs and the program utilities, then Lisp should display the following messages after the command above:
--EVALUATION FEEDBACK-- NOTE: - Each question is worth 100 points. - Your score is the sum of your questions' points divided by the number of questions in the assessment. END OF NOTE. Your score: 0 (out of 100) ...
- That’s it. The Lisp programming environment is now installed and configured.