Difference between revisions of "Slime"

From ArchWiki
Jump to: navigation, search
(added 64 bit howto)
(Remove out-of-date flag, replace link to .install file)
(23 intermediate revisions by 13 users not shown)
Line 1: Line 1:
[[Category:Development_(English)]]  
+
[[Category:Development]]
 +
== Introduction ==
  
Here is one way to get a lisp programming environment using emacs and slime and sbcl. Common Lisp was used to build viaweb by Paul Graham with 3 coders in 1995. It sold to yahoo for 50M us $ and became yahoo store. Lisp also powers orbitz.com. Other Lisp resources include scsh, drscheme, the book SICP, and Practical Common Lisp by Peter Seibel(free online), as well as ANSI common lisp and On lisp(free online) by Paul Graham.  A gentle introduction to symbolic computation by Touretsky is free online as well. Happy hacking!!!
+
[http://www.common-lisp.net/project/slime/ SLIME] (Superior Lisp Interaction Mode for [[Emacs]]) provides a development environment for [http://www.sbcl.org SBCL] (detailed in this article), [http://www.cons.org/cmucl/ CMUCL], [http://clisp.cons.org/ CLISP] and other [http://en.wikipedia.org/wiki/Lisp_(programming_language) Lisp] implementations.
  
emacs - editor
+
The components required are:
  
slime  - lisp mode for emacs
+
* '''emacs'''
 +
* '''sbcl'''
 +
* '''slime'''
  
sbcl   - a common lisp implementation (clisp is another good one, just substitute clisp for sbcl in the following)
+
== Installation ==
 +
[[Pacman|Install]] {{Pkg|emacs}} and {{Pkg|sbcl}} from the [[official repositories]] and {{AUR|slime-cvs}} from the [[AUR]].
  
To get excited about lisp and programming: www.paulgraham.com is recommended.
+
== Configuration ==
  
www.cliki.net is a great lisp site
+
''From the [http://pkgbuild.com/git/aur-mirror.git/plain/slime-cvs/slime.install .INSTALL] file.''
  
pacman has emacs and sbcl packages:
+
To make use of slime, add the following lines to your [[Emacs#Customization|init file]]:
#  su - root
+
 
# pacman -Sy emacs sbcl  (say yes)
+
  (setq inferior-lisp-program "/path/to/lisp-executable")
# cd /home/userX
+
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
# wget http://aur.archlinux.org/packages/slime/slime.tar.gz
+
(require 'slime)
# tar xzvf slim--.tar.gz
+
(slime-setup)
#cd slime
+
#makepkg
+
#pacman -U slime-XX.tar.gz
+
+
Now to setup emacs to use slime by creating a .emacs file:
+
change user to userX and in /home/userX to create your .emacs file, vi .emacs; mine is:  
+
# vi .emacs (now paste the below into this file, changing g to whatever you userX is, then ESC, :wq to save, apologies if you are a vi whiz!)
+
  (setq inferior-lisp-program "/usr/bin/sbcl")
+
  (add-to-list 'load-path "/home/g/slime/pkg/usr/share/emacs/site-lisp/slime/")
+
  (require 'slime)
+
  (slime-setup)
+
  
 +
Then run {{Ic|M-x slime}} from within emacs.
  
--my userX is g, and /usr/bin/sbcl is path to steel bank common lisp (switch to clisp or CMU lisp if you like, which are other great common lisp implementations)
+
Alternatively, for a fancier slime setup, you can change the above lines to:
+
--then save [:wq], and [emacs & enter] to launch emacs, [ALT-x slime -return-] to enter slime mode, which takes like 10s to load, and there you are a nice working lisp dev environment.  Emacs has its own tutorial built in and www.sbcl.org has info on sbcl..enjoy..
+
  
 +
(setq inferior-lisp-program "/path/to/lisp-executable")
 +
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
 +
(require 'slime)
 +
(slime-setup '(slime-fancy))
  
FOR 64 BIT:
+
== Resources ==
as root
+
 
pacman -S emacs clisp
+
* [http://www.cliki.net/ The Common Lisp wiki]
wget slime from slime website
+
* [http://www.gigamonkeys.com/book/ Practical Common Lisp]
chown -R user: /usr/bin/clisp and slime dir
+
* [http://mitpress.mit.edu/sicp/full-text/book/book.html Structure and Interpretation of Computer Programs]
untar slime, follow readme by creating .emacs file in your users home....
+
* [http://www.paulgraham.com/lisp.html Paul Graham's Lisp resources].
start emacs, ALT-x slime
+
thats all there is to it....
+

Revision as of 19:00, 22 October 2013

Introduction

SLIME (Superior Lisp Interaction Mode for Emacs) provides a development environment for SBCL (detailed in this article), CMUCL, CLISP and other Lisp implementations.

The components required are:

  • emacs
  • sbcl
  • slime

Installation

Install emacs and sbcl from the official repositories and slime-cvsAUR from the AUR.

Configuration

From the .INSTALL file.

To make use of slime, add the following lines to your init file:

(setq inferior-lisp-program "/path/to/lisp-executable")
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
(require 'slime)
(slime-setup)

Then run M-x slime from within emacs.

Alternatively, for a fancier slime setup, you can change the above lines to:

(setq inferior-lisp-program "/path/to/lisp-executable")
(add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
(require 'slime)
(slime-setup '(slime-fancy))

Resources