So it has been a while since I wrote something useful. I have either an excuse or an explanation, (depending on how you value excuses). Two weekends ago, I got sick and, long story short, I got better but I had to sleep a lot to do it. Ergo, no polyphasic sleep during that time. I’ve been sleeping like a normal person, except my wife has had trouble sleeping so I’ve been sleeping for maybe 6-7 hours, with a 30-60 minute interruption somewhere in the middle. What did this do to me? It made me really, really tired! I’ve been sleeping too much and doing a bad job at it, and I’m sick of it. I’m taking one last night sleep tonight and then tomorrow I’ll start taking my naps and staying up at night. And I’m very much looking forward to getting that time back.
So with 5 fewer hours a day to work, what did I cut out and what did I keep? Well, I haven’t a) written quality blog material, b) done housework chores, c) programmed as much, or d) made all the great improvements people suggested to my SLIME/Emacs cheat sheet. I decided that if I only had a little time, I should spend it on what’s most important, which right now is sharpening my Lisp skills. I’m trying to get to a point where I can work on programming for my startup without referring to documentation for every single thing I try to do. That consists of 3 things:
- get better at Lisp (currently working through Practical Common Lisp)
- learn to use ASDF (so I don’t have to only use one file)
- customize Emacs and learn more commands
#1 is going nicely. Unfortunately, #2 and #3 pose a bit of a problem. I’m currently using the Allegro-bundled LispBox for Windows from the PCL website. It’s been great for getting started, getting comfortable with basic commands, and getting familiar with SLIME and Emacs. However, it’s not conducive at all to customization. I’m not saying that it can’t be customized, just that it is a minor distribution for new users, so there’s not a lot of documentation out there for working with it. Three big strikes: (Windows, LispBox, Allegro) means that there are very few users, very few comments, and very little help.
For instance, ASDF is included and configured correctly, with the code from PCL already setup and easy to load. However, I tried for (too long) to get ASDF to load my code. I wrote my own packages.lisp and .asd files, I tried pushing values for my directory to the asdf:*central-registry* so I didn’t have to make a zillion shortcut files, etc. Long story short, it didn’t work and nowhere on the Google did anyone have specific advice for my setup. Ditto with .emacs customization with Lispbox (for anyone who’s wondering, I think it’s at C:\Program Files\acl81-express\misc\dot-emacs.el, but I couldn’t get the settings to load. YMMV). It’s just too obscure and I don’t have the time to figure out everything on my own, so I’m moving to a more mainstream setup.
So I put development and practice mostly on hold so I could get a more common setup that will make it easier to get help with when (not if) I have issues. I’m still working on the setup, becuase I spent a lot of time researching recommendations and best practices. I want to get it right (or at least mostly right) the first time so I don’t have to go back and re-do everything again. Tweaking is fine and I plan to keep doing that forever, but no more redos. I’ll put out another n00b type giude (along with rationales) when I get my own setup working, but here’s what I’ve come up with:
- Emacs 22.1
- SLIME 2.0
- CLisp
- Cygwin(?) – I’m trying to limit the number of tools I have to deal with so I wanted to leave out Cygwin. Can anyone give advice on whether it will make my life easier or harder in the short term?
Thanks to everyone who has expressed interest in the meantime. Keep your eyes out for more guides and an update to the cheat sheet. That’s my motto, helping the n00b in all of us!
UPDATE: I wrote this on Thursday but haven’t been able to post until Friday night. I’ve taken two naps, planning on staying up at night, and I feel great! I’m already happy to be back on a polyphasic schedule!
novaburst says
I’m using Emacs, Slime and SBCL on Linux because it seemed to be the most popular. Are you targeting Windows with your company or can you switch to Linux?
Although I run a Windows box as well, I notice most Lispers using Linux if using a free Lisp implementation. But if there is a good way to set this up in Windows I would be interested as well. I have tried Lisp in a Box too, by the way.
Johnny Kwan says
http://bc.tech.coop/blog/070927.html
http://common-lisp.net/project/asdf-install/tutorial/setup.html
I’m facing the same challenges and had a long involved comment on how to install Cygwin, Cygwin-CLisp, Windows native Emacs, and SLIME. But the submit failed, and I lost it, and I don’t feel like typing it again.
Johnny Kwan says
Ah, to hell with it. I don’t think I can get around this, and I need all the help I can get, so I’ll be commenting again in chunks.
Get Cygwin
Windows command line sucks. Bash is much better. Also, Cygwin comes with a package installer, a la RPM, APT, and YUM. Also, the utilities can’t be beat, so get Cygwin.
Run the setup.exe installer. By default, the installer and all installation sources are downloaded to C:\Program Files\cygwin. Cygwin itself is installed to C:\cygwin.
Only the core stuff is installed by default. When you want to add another Cygwin program (like CLisp), you have to specifically enable it. You can rerun C:\Program Files\cygwin\setup.exe at any time for this purpose.
Johnny Kwan says
XEmacs doesn’t feel right. The GNU Emacs that comes with Cygwin can be run in two modes: console and X-window. Neither feel right in Windows. So I use native Windows GNU Emacs. (You can drag-and-drop lists of files from Windows Explorer onto the Emacs window to open them, among other things.)
Download http://ftp.gnu.org/pub/gnu/emacs/windows/emacs-21.3-bin-i386.tar.gz, which contains the Windows binaries. Use the Cygwin bash prompt to unzip and untar this file into its own folder (tar -xvf). I rename the folder to emacs-22.1 and move it into C:\Program Files.
Modules intended for use by all users of the PC should be maintained in the site-lisp directory of the emacs directory. That’s where I put everything.
Native Windows Emacs has to be “cygwinized”, i.e. convert Unix paths to Windows paths. To do this, get the cygwin-mount.el and setup-cygwin.el files from the Emacs Wiki and download them to site-lisp. Then put the following in your .emacs:
(require ‘setup-cygwin)
Unfortunately, there’s a bug (unhandled case?) that SLIME trips across. I’m unclear on the specifics, but here’s the workaround:
http://www.cliki.net/SLIME%20Tips
in the Cygwin section
You essentially tell Cygwin that /c is the same as C:\.
Johnny Kwan says
Oops, I meant http://ftp.gnu.org/pub/gnu/emacs/windows/emacs-22.1-bin-i386.zip.
Johnny Kwan says
Before getting SLIME, you have to tell Emacs to use your Lisp binary. I use CLisp from Cygwin for convenience and cost. To get Emacs to pick it up, I add this to my custom-set-variables command in my .emacs:
‘(inferior-lisp-program “C:/cygwin/bin/clisp.exe -K full”)
You can, of course, use setq if you want.
Johnny Kwan says
Get SLIME. Unzip it to the site-lisp directory, in its own slime directory.
In your .emacs:
(add-to-list ‘load-path “C:/Program Files/emacs-22.1/site-lisp/slime”)
(require ‘slime)
(slime-setup)
Now SLIME should be all set. Restart Emacs, and issue M-x slime. Emacs should start a Clisp process and hook a SLIME REPL to the CLisp port.
Johnny Kwan says
ASDF is where I’m stuck. I tried following these directions for installing ASDF-INSTALL:
http://common-lisp.net/project/asdf-install/tutorial/setup.html
However, CLisp seems to be ignoring my .clisprc.
Also, there’s a package called slime-asdf which comes with SLIME. This is how to load it:
http://bc.tech.coop/blog/070927.html
However, it doesn’t install ASDF itself, it just makes SLIME aware of ASDF.
That’s all I’ve got. Please let me know if you get any further or exhaust any leads.
Peter says
novaburst – I’m using Windows because it’s one constraint that’s not that flexible, plus it’s one more thing to learn while I’m already juggling several. My best machine is my work laptop (can’t muck with OS), then my home desktop (share with wife, can’t do Linux there), then my home laptop (weird hardware that has never run Linux well) and then my other home desktop (it has Linux on it but it’s hard to get excited about your 4th best computer).
Johnny – Sorry for the posting problem – I think it’s the Apache setup on my shared host. You may have inspired me to finally deal with it (but it’s one more painful thing taking me away from fun stuff). Thanks for the tips so far, that jives with mostly with what I’ve already read. I especially appreciate the cygwin tips.
The one tip I would give you (based on reading lots of discussions on the intarweb) is that IF YOU’RE ON WINDOWS, DON’T BOTHER WITH ASDF-INSTALL. The process relies way too much on the Linux toolchain that trying to force Windows/Cygwin to use it just isn’t worth it. Just download packages manually and set up ASDF by hand. When I get around to posting about my ASDF experiences, I’ll link to references there.
Chris says
I use Cygwin’s Clisp in Cygwin’s Emacs with Slime (I’m also running Cygwin’s X11 to get the Emacs gui). I tell Slime where Clisp is in my slime.el, then load that. Works fine. ASDF works without issue for me under Cygwin. In .clisprc (which must be in the Cygwin home directory) I put –
#-:asdf (load “/home/Chris/asdf/asdf”)
(pushnew “/home/Chris/asdf/asdf_registry/” asdf:*central-registry* :test #’equal)
The forward-slash after asdf_registry indicates that it’s a directory, not a file. It contains symlinks (NOT Windows shortcuts) to all my .asd files (create symlinks under cygwin with this command: ln -s /path/to/relevant/asd-file). I haven’t yet tried ASDF-Install, so can’t comment on that (suspect it won’t work, though).
I have also managed to get ASDF to work with the Win32 port of SBCL. SBCL comes bundled with a version of ASDF, but I could never get it to work. A patched version of asdf.lisp which DOES work can be found here –
http://www.lichteblau.com/blubba/shortcut/asdf.lisp
Create a .sbclrc file in your home directory (find out where SBCL thinks that is by evaluating (user-homedir-pathname)), and add the following –
(require ‘asdf)
pushnew “/path/to/asdf/central-registry/” asdf:*central-registry* :test #’equal)
I have symlinks in my asdf registry, so I can’t vouch for ordinary Win32 shortcuts with SBCL.
Hope some of that helps anyone who’s understandably experienced difficulty with this issue (quite a few people, it seems).