Clementson's Blog

Bits and pieces (mostly Lisp-related) that I collect from the ether.

January 2006
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31
Dec  Feb

Managing CL Libraries - Part 2

Sunday, January 8, 2006

Most people use ASDF to load libraries that they get from other people and to create system definitions for their own libraries. Daniel Barlow originally developed ASDF and you used to have to download it from his site; however, most of the popular CL implementations now bundle it as part of their distribution so it has become pretty much ubiquitous. However, even though ASDF is good at what it does, there are a number of common things that people need to do that are "ASDF-ish" and which aren't catered for by ASDF itself. Therefore, some ASDF extensions have been developed that fill gaps in what ASDF is able to do. The ones that I personally use the most are asdf-install (initially developed by Daniel Barlow and made portable across multiple installations by Edi Weitz) and asdf-upgrade (a new addition developed by James Bielman). I've already posted previously about asdf-install and how I use it. It's a wonderful tool for automatically installing all the dependent libraries that one needs in order to use a particular library. However, you used to have to manually check whether any of the libraries that you had asdf-install'ed had been updated and re-install them if they had. Now, however, asdf-upgrade can be used to automate this. When you run it, you can ask for a report on all the libraries that you have asdf-install'ed and it will tell you if there is a newer version available. Then, you can choose to upgrade to the latest libraries if you want. Pretty nifty! Here's a sample REPL session to give you an idea of what it does:

CL-USER> (asdf-upgrade:REPORT)
Name            Version  Upgrade Status
------------------------------------------------------------------------
cl-base64       3.3.1    Up to date
cl-fad          0.4.0    Upgrade available
cl-html-parse   unknown  Upgrade available
cl-ppcre        1.2.13   Up to date
cl-who          0.6.0    Up to date
kmrcl           1.84     Up to date
md5             1.8.5    Up to date
net-telent-date 0.41     Up to date
puri            1.3.1.3  Up to date
rfc2388         unknown  Up to date
rt              20040621 Up to date
split-sequence  unknown  Up to date
tbnl            0.9.3    Upgrade available
url-rewrite     unknown  Up to date
NIL
CL-USER> (asdf-upgrade:upgrade)
;; Checking available packages..............done
;; The following packages will be upgraded:
;;   tbnl cl-fad cl-html-parse
[snipped installation output]
NIL
CL-USER> (asdf-upgrade:REPORT)
Name            Version  Upgrade Status
------------------------------------------------------------------------
cl-base64       3.3.1    Up to date
cl-fad          0.4.2    Up to date
cl-html-parse   unknown  Up to date
cl-ppcre        1.2.13   Up to date
cl-who          0.6.0    Up to date
kmrcl           1.84     Up to date
md5             1.8.5    Up to date
net-telent-date 0.41     Up to date
puri            1.3.1.3  Up to date
rfc2388         unknown  Up to date
rt              20040621 Up to date
split-sequence  unknown  Up to date
tbnl            0.9.4    Up to date
url-rewrite     unknown  Up to date
NIL
CL-USER> 
Another useful addition is a set of utilities that were developed by Gary King (of UnClog fame). Probably the lasting effect of the switch of Reddit from Lisp to Python was a realization that Lisp libraries are harder to use than they need to be. John Wiseman highlighted the issue when he posted a weblog entry showing how few libraries could actually be successfully installed using asdf-install. As a result, Gary King developed a couple of utilities (called asdf-install-tester (or AIT) and asdf-status) that can be used to test whether asdf-install-able libraries are actually installable. In addition, he has indicated that he will be running the utility on a monthly basis (and providing the results at the links listed below) in order to provide an ongoing "sanity check" of which libraries are installable. This is useful to both library authors and users. The output that he currently provides is: systems graph

So, although Gary's utilities are unlikely to be actually "used" by many people, the output from his utilities will be extremely valuable in improving the quality of CL libraries. Gary is to be commended for his work on these utilities and for the service that he is providing to the Lisp community!

In addition to these utilities, there are a number of other utilities that are listed on the asdf-extension CLiki page. I haven't personally used the other utilities; however, they scratch certain itches and are worth checking out. All-in-all, the combination of these utilities is helping to make CL library installation easier, more robust, and more consistent. This is all good stuff!

emacs Copyright © 2006 by Bill Clementson