views:

371

answers:

3

Here is the back story skip to the bottom if you do not care and only want to see the question.

So I have been playing around in LISP for a little while. Some basic functions, some classes ,and file IO. When I run across this article:

http://www.adampetersen.se/articles/lispweb.htm

And I am excited to try and use lisp for a web application. I go and download the packages, but for the life of me do not know how to load them into my Allegro IDE.

Hmm... ok, well the hunchentoot site says a lot of the basic packages are in LispWorks. So I download that. Still not sure how to get the source for the packages that I downloaded into these IDEs. They seem to have binaries of the packages?

Oh well maybe ill switch to my ubuntu server and apt-get all the packages and setup slime (i have not used it before because I just wanted to learn lisp. Learning emacs and lisp at the same time seemed real daunting). I apt get all the packages needed and load up slime and again same problem there aren't available.

I dig around some more and see this program called ASDF. It looks like ASDF is some kind of package builder for lisp? I don't know it seems confusing. I'm about to give up at this point.


If you are still reading this here is my question.
1. How do I load the source for these packages into my lisp environment. trying to learn lisp hasn't been too hard but the information about the environments has been sparse. Do I need to build the packages I download with ASDF.
2. Is there a simple way for someone to just get up and running in lisp without having to speed a large amount of time upfront learning all the tools?

+5  A: 

The quickest way in Ubuntu is to use the packages included in that distribution. It is "ok" if you just want to try some things, but these versions are often comparatively old. I would recommend the packages sbcl and slime. If you don't know emacs yet, you can get into that quite fast through its built-in tutorial (C-h t (press Control-h, release, then press t)).

You can then start emacs, start slime (through M-x slime), open a lisp file (C-x C-f ~/lisp/first-try.lisp), and you're ready to go. As a tutorial for Lisp, I think that Practical Common Lisp is a very nice book, and it's freely available.

Now, when you have come to like Lisp, you might want more up to date packages. I would recommend to use clbuild for that (see the link for further information, including FAQ). You can then also build a new sbcl (bootstrapped by the distribution's version).

ASDF, by the way, is only a system definition facility. It doesn't know how to download packages, it only knows how to load systems into a running Lisp image. In other words, it just solves the problem of automatically loading the multiple files that some "system" (library) consists of in the right order. The newest versions allow loading a package (after it is installed, e.g. through clbuild) with a simple

(asdf:load-sys 'foo)

Older versions show ASDF's internal concept of operations:

(asdf:operate 'asdf:load-op 'foo)

The above load-sys is a shorthand for this common use case. Further information (one could say, all you need to know about it) is at the ASDF Getting Started guide. ASDF is also included in SBCL.

When you load a source file, it is automatically compiled (producing .fasl files (fast-load)) so that loading is much faster next time.

Svante
+2  A: 

Probably one of the fastest ways to get started is to use Lisp in a Box (or a spinoff like LispBox). These are full sets of everything you need.

You could also try the Lisp Resource Kit, which is a bootable CDROM with Lisp tools and documentation, all already set up for you. Just put it into your CDROM drive and boot!

David
+4  A: 

Hmm... ok, well the hunchentoot site says a lot of the basic packages are in LispWorks. So I download that.

This just means that the author has written a lot of Lispworks-specific code in Hunchentoot. It does not mean that Hunchentoot only works on Lispworks.

Still not sure how to get the source for the packages that I downloaded into these IDEs.

You need to use ASDF.

They seem to have binaries of the packages?

That's unlikely.

Oh well maybe ill switch to my ubuntu server and apt-get all the packages and setup slime > (i have not used it before because I just wanted to learn lisp. Learning emacs and lisp at the same time seemed real daunting).

Don't do it then. You don't need to use Emacs or Slime.

I apt get all the packages needed and load up slime and again same problem there aren't available.

For quick results try clbuild: http://common-lisp.net/project/clbuild/

I dig around some more and see this program called ASDF. It looks like ASDF is some kind of package builder for lisp? I don't know it seems confusing.

ASDF is a bit like a Makefile for Common Lisp applications.

I'm about to give up at this point.

That's about the worst thing you could so (at this or any other point). I'm glad you have decided to post your problems here instead.

  1. How do I load the source for these packages into my lisp environment. trying to learn lisp hasn't been too hard but the information about the environments has been sparse. Do I need to build the packages I download with ASDF.

clbuild should give you all you need, but here are some hints if you don't want to use it:

  1. CLISP, SBCL: ASDF is part of your Lisp. Run (require :asdf). Lispworks, Allegro: you need to download and load ASDF. Save asdf.lisp somewhere then run (load "/path/to/asdf.lisp").
  2. For every library/application ("system" in ASDF speak) you need to download und unpack it to some place. Repeat until all dependencies are satisfied. Note down these places (directories).
  3. For every place from step #2 add the place to the ASDF registry: (push "/path/to/dir/" asdf:*central-registry*). Don't forget the trailing slash.
  4. Load the system using (asdf:oos 'asdf:load-op :system-name).
  1. Is there a simple way for someone to just get up and running in lisp without having to speed a large amount of time upfront learning all the tools?

See above -- use clbuild.

skypher
Step 4 can now be (asdf:load-sys :system-name).
Svante