Search code examples
buildcommon-lispsbclasdf

Getting started with ASDF package management and Common Lisp


I'm having trouble getting started with ASDF and Common Lisp.

How can I get a minimal example working?


Solution

  • To answer my own question:

    So, how to do your "Hello World!" with ASDF build system? Here's what worked for me. I'll help you side-step the time-consuming traps that I fell into.

    Watch this video. He explains installation of sbcl, emacs, quicklisp (a Lisp library manager), slime, and quickproject, which sets up a project with ASDF.

    Now to side-step a few traps:

    • slime didn't seem to work with clisp. I had to use scbl. Note, I'm on ubuntu 16.04.
    • You must have your .asd file in the path of your ASDF system. You can accomplish this by working in ~/common-lisp/; if you don't have it you can make it. See here to setup ASDF to look in other directories.
    • Once you have they system built, load the system with (asdf:load-system :<system>). Also, to access functions in a different package, use the following syntax: (<package>::<function> ...).

    Happy coding.


    For vim users: Emacs and Lisp, specifically with quicklisp and emacs's package manager, is a beautiful combination. Probably because Emacs is written in Lisp. I see the value of this. But I'm a vim user. I was pleased to find Evil, a great vim layer for emacs. Check out this 4 minute video, which impressed me. Also, here is a post of another vim user setting it up to be like his vim environment, better in some cases. I now think the combination of emacs and vim is better than either alternative.