My code is grouped by 'operational unit' rather than class. I do not use ASDF for my own code (but I might've if my code were intended to be a library).
In my large program I tried to have very little 'project defining code' overhead. I got the idea from Forth which (in some versions) don't even have files insead only having 1024 character 'screens'. What Forth users do is have the first screen (screen 0) work like a table of contents and load other blocks where real program code is. So my first lisp file is called 'load.lisp', it loads all the SBCL extensions (using :require) then loads asdf libraries and then my files.
Most of my code is in source subdirectories. I have 1 package per file, and I name them as :subdir.file. 'Util' is my first subdirectory which contains util.lisp (generic utilities), tree.lisp (a really simple tree built from lists), and encrypt.lisp (my interface to some encryption/md5 libraries) etc. These files define packages util.util, util.tree and util.encrypt. My other source subdirectories are database, forth, view, http, and web. I do not have second level load.lisps in subdirectorys, the toplevel load.lisp loads every file.
Since package-names = directory paths I created a perl script to compute lisp file dependencies which I used in a makefile. Later on, I adopted another Forth principle: Source Code = Object code. In color forth there is no intermediate stage called object code (in fact, you directly edit object code with what is almost a decompiler). In Lisp there is a destinction between source and object code, but I ignore it. My build is SBCL --load "load.lisp" --eval "(build-image)", where (build-image) is a routine defined at the end of load.lisp that calls 'save-image-and-die'. In my makefile I named this target server.core.
To deploy I invoke a makefile target called deploy which tar.gzs the makefile and source directory. I then secure copy (using scp from the ssh tools) and untar it on the server, build and install it. Then I delete the source code off the server. To make installation simple, I compile a lot of external files right into my lisp core image. For example, most of the images my server uses and the CSS files are compiled into the program using compile-time-value. These data files I store in the source directory as well, under a subdirectory called 'static'.
Code: Select all
(define compile-time-value (expr) (eval expr))