Difference between revisions of "Slime"

From ArchWiki
Jump to: navigation, search
(Attempted cleanup and consolidation)
Line 1: Line 1:
{{stub}}
+
[[Category:Development_(English)]]
[[Category:Development_(English)]]  
+
==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!
+
  
* '''emacs''' - editor
+
== Introduction ==
* '''slime''' - lisp mode for emacs
+
* '''sbcl''' - a common lisp implementation (clisp is another good one, just substitute clisp for sbcl in the following)
+
  
==Installation==
+
[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.
The Arch repositories have emacs and sbcl packages:
+
# <code>$ su - root</code>
+
# <code># pacman -S emacs sbcl</code>
+
# <code># cd /home/userX</code>
+
# <code># wget http://aur.archlinux.org/packages/slime/slime.tar.gz</code>
+
# <code># tar xzvf slim--.tar.gz</code>
+
# <code># cd slime</code>
+
# <code># makepkg</code>
+
# <code># pacman -U slime-XX.tar.gz</code>
+
  
'''Note:''' as an alternative to steps 3-8, you can install the slime-cvs package instead of going through AUR:
+
The components required are:
<code> pacman -S slime-cvs</code>
+
  
==Configuration==
+
* '''emacs'''
Now to setup emacs to use slime, change user to userX and go to /home/userX. Now to edit your .emacs file, run:
+
* '''sbcl'''
$ vi .emacs
+
* '''slime'''
Now paste the below into this file, changing <code>g</code> to whatever you userX is.
+
 
  (setq inferior-lisp-program "/usr/bin/sbcl")
+
== Installation ==
  (add-to-list 'load-path "/home/g/slime/pkg/usr/share/emacs/site-lisp/slime/")
+
 
 +
# pacman -S emacs sbcl slime-cvs
 +
 
 +
{{Note|It is also possible to install <tt>[http://aur.archlinux.org/packages.php?ID=6191 slime]</tt> from the AUR, though the <tt>-cvs</tt> package is recommended by the upstream developers.}}
 +
 
 +
== Configuration ==
 +
 
 +
From the <tt>.INSTALL</tt> file:
 +
 
 +
To make use of slime, add the following lines to your [[Emacs#Customization|init file]]:
 +
 
 +
  (setq inferior-lisp-program "/path/to/lisp-executable")
 +
  (add-to-list 'load-path "/usr/share/emacs/site-lisp/slime/")
 
  (require 'slime)
 
  (require 'slime)
 
  (slime-setup)
 
  (slime-setup)
  
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). '''Note:''' if you installed slime-cvs instead of the package from AUR, <code>load-path</code> should be set to <code>/usr/share/emacs/site-lisp/slime/</code>
+
Then run <tt>M-x slime</tt> from within emacs.
 
+
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..
+
  
==For 64-bit==
+
== Resources ==
*As root: pacman -S emacs clisp
+
*wget slime from slime website
+
*chown -R user: /usr/bin/clisp and slime dir
+
*untar slime, follow readme by creating .emacs file in your users home....
+
*start emacs, ALT-x slime
+
  
==External Resources==
+
* [http://www.cliki.net/ The Common Lisp wiki]
*To get excited about lisp and programming: http://www.paulgraham.com is recommended.
+
* [http://www.gigamonkeys.com/book/ Practical Common Lisp]
*http://www.cliki.net is a great lisp site
+
* [http://mitpress.mit.edu/sicp/full-text/book/book.html Structure and Interpretation of Computer Programs]
*http://www.gigamonkeys.com/book/ has an intro to Common Lisp and SLIME, and goes through the whole LISP language, giving practical examples
+
* [http://www.paulgraham.com/lisp.html Paul Graham's Lisp resources].

Revision as of 03:43, 6 March 2010


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

# pacman -S emacs sbcl slime-cvs
Note:
Template error: are you trying to use the = sign? Visit Help:Template#Escape template-breaking characters for workarounds.

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.

Resources