Arc Forumnew | comments | leaders | submitlogin
Arc, Emacs, and SLIME
2 points by zck 4862 days ago | 4 comments
Here's how to set up SLIME with Arc. I'm using Linux, but the gist should be the same on Windows.

First, download SLIME from http://www.common-lisp.net/project/slime/snapshots/slime-current.tgz . Then, we have to unzip it. I chose to put SLIME in ~/.emacs.d/slime . You can choose differently; it doesn't matter where as long as you know where it is. Obviously, pathnames will be different on Windows.

  zck@zck-desktop:~/Desktop$ mv slime-current.tgz ~/.emacs.d/
  zck@zck-desktop:~/Desktop$ cd ~/.emacs.d/
  zck@zck-desktop:~/.emacs.d$ tar -xf slime-current.tgz 
  zck@zck-desktop:~/.emacs.d$ ls
  slime-2011-07-31
  zck@zck-desktop:~/.emacs.d$ mv slime-2011-07-31/ slime/
Ok, now SLIME is in ~/.emacs.d/slime . The way SLIME deals with Lisps is by calling an executable. The only way I could get SLIME to work with Arc is by writing a shell file to start Arc properly. I'm calling that file ~/arc.sh . We need to do two things in the shell script. First, move to the directory Arc is saved in. Then, we start Arc. However, you have to fully specify the path to Racket. My racket is at /usr/local/racket/bin/racket . Yours may be different; you can check this on Linux by going to a terminal window and typing which racket . This will output the executable that's called when you run racket . On Windows, Racket is probably somewhere in C:\Program Files . Make sure you pick the executable, not the folder holding it.

  zck@zck-desktop:~/.emacs.d$ which racket
  /usr/local/racket/bin/racket
So we take these two commands and put them in your arc.sh file. Unfortunately, I don't have a Windows machine at hand, so I can't test this out there. If someone would supply a valid Windows script, that would be a great help.

  cd ~/arc3.1; # a fully-qualified path to wherever your arc3.1 is
  /usr/local/racket/bin/racket -f as.scm #get the location of racket
                                         #from running: which racket
                                         #at a terminal window
Save this, and make the file executable:

  zck@zck-desktop:~$ chmod a+x arc.sh
Next step: tell Emacs about SLIME. Open up your .emacs file. If you don't know what your .emacs file -- also called your init file -- is, read the emacs wiki article about it: http://www.emacswiki.org/emacs/InitFile . Add the following:

  (setq inferior-lisp-program "~/arc.sh")
  (add-to-list 'load-path "~/.emacs.d/slime/")
  ;; customize these locations as per your setup
  (require 'slime)
  (slime-setup)
Close and restart Emacs, and then run M-x slime. If all went well, you should get something like the following:

  (progn (load "/home/zck/.emacs.d/slime/swank-loader.lisp" :verbose t) (funcall (read-from-string "swank:start-server") "/tmp/slime.2040" :coding-system "iso-latin-1-unix"))

  Use (quit) to quit, (tl) to return here after an interrupt.
  arc> Error: "reference to undefined identifier: _progn"
  arc>
I don't know why SLIME sent a progn to Arc, but as far as I can tell, Arc is working just fine even with the complaint. Good luck!


1 point by zck 4861 days ago | link

Re-reading, I don't know how I missed that the first line of output is a 'progn statement. Obviously arc will barf on it. I don't know what won't work because SLIME wasn't able to load 'swank and start it.

-----

1 point by zbeane 4861 days ago | link

Everything that makes SLIME worth using will not work.

-----

2 points by shader 4854 days ago | link

What makes you say that? What features would you consider "make it worth using", and why won't they work? It's quite possible that all that needs to be done is change a few variables or replace a few functions to use arc names instead of CL names. Case in point being progn -> do, etc.

-----

1 point by HankR 4841 days ago | link

swank is the lisp package that does all of the slime heavy lifting on the lisp runtime. It manages threads, executes code, interfaces with the debugger, does various reference/definition lookups, etc. It consists of a large CL package with a smaller, environment specific set of functions that are defined for each lisp environment (SBCL, Clozure, etc.) In addition, slime and swank are tightly bound, and changes to one requires changes to the other. One or the other change fairly frequently. Porting swank to work with something like ARC would be a major undertaking, maintaining it would probably be worse. It's probably not worth the effort. It would probably be just as fast to create a new arc editing interface.

-----