[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Summary of Responses to Re: Managing large LISP code

     Most people who wrote to me said that defsystems are the
way to handle large Lisp code.   Defsystems are essentially
to Lisp what makefiles are to C.   One lists dependencies and
Lisp can figure out what to recompile.   They may be a little
more powerful than makefiles.  Unfortunately, there are no
standard defsystems for Lisp, and many versions float around.
no standard defsystem.   A popular defsystem is by Kantrowitz which I think
has a reference in the Lisp FAQ (under Lisp Utilities).   

    Another popular defsystem are defunits which were written
by Guillaume Cartier.   defunit material should be obtainable
in the contrib directory at the anonymous FTP site,
cambridge.apple.com.    I have looked in there and the
closest thing I have found is under pub/MCL2/Contrib
which has Cartiers-Contribs-1.2.sea.hqx.   I assume hqx
is some kind of compression.   I have no idea what is in
this however.   One respondent really liked this particular
defsystem though it seems to be made specifically for MCL.

    The only book that was recommended that discussed style
issues is a book called "Lisp Style and Design".   Well,
actually, Norvig's book (which has to do with AI programming
in Lisp) was also mentioned.

   The main drawback to defsystem's, other than a lack of
a standard, is the relative poor documentation.   The documentation
that was available, says one respondent, lacked enough examples,
and it was difficult to get the defsystems to work.   My opinion
is that somewhat inferior software can be more popular than
better software if good documentaion is available.  Anyway,
that about summarizes the responses I received.   Thanks
for those who sent me replies.

   Let me just include one response I had.   The others are somewhat

This is from Thomas Russ

The "standard" method for handling large amounts of code is to use one
of the defsystem utilities that are floating around in cyberspace.

[I put the standard in quotes because there are numerous (and mutually
incompatible) versions of defsystem floating around.  As long as you
don't need to interact directly with other groups, then you can pretty
much pick anyone you want.  Mark Kantrowitz' version (from CMU) is one
of the more popular ones.]

A defsystem utility is akin to make, in that it lets you define a set of
modules and files with their dependencies (for order of compilation and
loading).  Then, when you need to recompile, only the affected files are
actually compiled.  The definition of the system is done in a separate
file.  There are some other bells and whistles depending on exactly
which one of the competing ones you use.  In fact the MCL distribution
comes with several varieties to choose from in the examples:Defsystem

There are also some other common conventions that are used in large SW

    o  special variable names begin and end with "*"
    o  each major functional unit has its own package
    o  only external interface function names are exported from packages
    o  external interface functions are given documentation strings

In some systems, macros are collected into a separate file.  This can
have drawbacks, however, since any change to the macro file then means
you have to recompile the entire system.  One of the advantages of lisp
functions is that the dynamic linking means you don't need to specify a
particular load order.

The editors and development environments and tools generally come
attached to a particular implementation.  All good development
environments come with a Meta-. (Meta-dot) command which prompts for a
functions/macro/variable name and takes you to the definition in the
editor.  Less widely available is a "who-calls" database that can help
you find all callers of a particular function as well.

Good luck.  I think Lisp is very good for developing and maintaining
large software systems.

- Tom.

Thomas A. Russ,  USC/Information Sciences Institute          tar@isi.edu    
4676 Admiralty Way, Marina del Rey, CA 90292          (310) 822-1511x775