[asdf-devel] Simplification of load operations

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sat Apr 17 09:26:19 UTC 2010


Right now we have a situation in which load-source-op is a second class
citizen, rarely used, and for which nobody provides explicit dependencies.
More precisely

* Some compilers out there are just efficient compiling and loading source
files. The operation is the same.
* LOAD-OP can be viewed as a slightly more efficient version of an operation
that loads sources.
* Some users out there do not like compile-before-load procedure.
* ASDF makes no promise that load-source-op will behave similarly as
load-op.
* Users define methods for load-op and not for load-source-op.
* In practice the dependencies *must* be the same, for the philosophy of CL
is that compiled and not compiled files behave similarly.
* The only differences should be enforced to lay just in the compilation
process.

I attach a patch which merges both operations, leaving a trace of
compatibility.

* There is only one class, LOAD-OP.
* The class has the promise that it will use the same dependencies when
loading sources and binaries.
* When imposing that one does compile the source before, the class issues an
additional dependency on a compile-op, which may pull additional
dependencies itself.
* A global flag, *compile-before-loading* determines the overall behavior
* A new function ASDF:LOAD-SOURCE-SYSTEM forces no compilation
* The function LOAD-SYSTEM gets a flag, :compile that sets
*compile-before-loading*
* With these changes it is easy to get a sorted list of the components that
make up a program. Furthermore, this list is guaranteed to work because we
are using the same operation that we will use to load the files.

(pprint
 (loop with asdf::*compile-before-loading* = nil
    for (op . component)
    in (asdf::traverse (make-instance 'load-op)
                       (find-system "chunga"))
      collect (list (type-of op) (type-of component)
                    (asdf::component-name component))))

* With this mechanism I can reimplement the fasl concatenation mechanism
*without* using classes at all. Same goes for ECL's extensions.

The patch is still not fully tested, but I submit it for discussion, so that
ugly corners can be polished.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://tream.dreamhosters.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/asdf-devel/attachments/20100417/78335a7c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: merge-load-source-and-binary-op.diff
Type: application/octet-stream
Size: 6235 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/asdf-devel/attachments/20100417/78335a7c/attachment.obj>


More information about the asdf-devel mailing list