The following is not intended to be an "Emacs with SLIME" commercial, but
"If you are looking for a good Common Lisp IDE you have the choice between Emacs with SLIME, Emacs with SLIME, and Emacs with SLIME." I would like to give credits to the original author of this citation, but stupidly I have forgotten where I have read it.
When I started with Lisp I used JEdit (a Java-based text editor that I already knew at that time) to write my Lisp code, then I saved the file to disk, and
LOADed the file from the Lisp REPL, running in a shell window. Although possible, it was rather tedious to work this way because I had to switch back and forth between the editor and the REPL rather often.
Today, using
Emacs with
SLIME, there is not much difference between working from a file or in the REPL because the REPL functionality is available in all Common Lisp file buffers (the Emacs window containing the text of the file), where the main differences and advantages of using Emacs and SLIME over JEdit and the REPL are:
- In an Emacs buffer containing Common Lisp code I can evaluate every single Common Lisp expression without LOADing the file, as if I were in the Common Lisp REPL. This way I can write and test code incrementally and interactively directly from the file buffer without switching to the REPL every time.
- If an error happens, an additional debugger window appears automatically, showing the backtrace (how the error happened) and all available restarts (how to continue).
- If my code has produced errors, SLIME underlines the part of the Lisp code that has caused the error, and if I move the mouse pointer over the underlined code, a small tooltip window appears showing the related error message. This way it's dead-easy to see which code has produced what error.
- SLIME has an integrated debugger and inspector (to investigate all sort of Lisp data at run-time), and a CLOS class browser.
Learning Emacs is a thing of its own. Because Emacs is based on Emacs Lisp (what is older and in some ways different from Common Lisp), most things can be re-programmed at run-time, too. There are Emacs Lisp extensions available that re-program Emacs beyond recognition. SLIME is also not a small Emacs extension, that cannot be learned within five minutes. I started learning Emacs and SLIME more than once until I finally got used to both, but today I think it was very much worth the effort.
Again I'm not such a nerd who thinks that Emacs is the "best text editor ever", but Emacs Lisp is similar to Common Lisp, and I often start prototyping simple things in Emacs Lisp and later switch to Common Lisp (mainly because Emacs Lisp has rather poor math support). Such things are not possible with
Vim and
slimv. That's not because I think that Emacs is "better" than Vim in all aspects, but Lisp development is easier with Emacs.
Here are some videos for people who want to see Emacs and SLIME in action:
and here is some text:
As a rule of thumb one can say that working with a familiar text editor is good for the beginning, just simply because learning Common Lisp is already complicated enough. As soon as switching back and forth between the editor and the REPL starts to become real pain, it's worth to look at Emacs and SLIME.
- edgar