maintaining non-Lisp systems with ASDF

Robert Goldman rpgoldman at sift.net
Thu Sep 17 18:11:06 UTC 2015


On 9/17/15 Sep 17 -12:57 PM, Robert Dodier wrote:
> Hi, I am exploring the possibility of using ASDF to define systems of
> non-Lisp code, specifically for Maxima (http://maxima.sourceforge.net).
> Maxima is written in Lisp but has its own language. I'd like to
> be able to load programs written in Maxima's language and/or
> Lisp.
> 
> It seems like ASDF should be suitable if I can just replace calls to
> COMPILE-FILE with Maxima's compile_file, and replace LOAD with
> Maxima's load. After looking over the 3.1.5 source code, it seems
> like one could clobber COMPILE-FILE* and LOAD* with Maxima-specific
> versions. That seems suboptimal, since it would be helpful to have
> the original versions of those functions for loading Lisp files.
> 
> Can someone give some advice about how to go about adapting
> ASDF to Maxima? Have there been similar attempts for other
> applications?
> 
> The bigger picture is that I'd like to use Quicklisp to download and
> install Maxima packages, and Quicklisp uses ASDF to compile
> and load stuff.
> 
This should be easy for you to do.

First, you need to subclass some kind of component for maxima source files.

You could either subclass cl-source-file, or perhaps something more
foundational.

You should, at least, provide methods for

PERFORM LOAD-OP <YOUR-CLASS>
and
PERFORM COMPILE-OP <YOUR-CLASS>

I believe information about doing this should be in the ASDF manual.

You may also need to tell ASDF what the file-extension of your types of
file is.

If there is a MAXIMA equivalent of a FASL file, you need to define
methods for OUTPUT-FILES and INPUT-FILES for your operations on your
component class.

That should be most of the solution.

Then you can make a new subclass of SYSTEM that will establish your
component type as the default file type for that system.  Then if you
specify that you are making one of your system subclass type (see the
manual for how to do this), then every :FILE component will be a
MAXIMA-SOURCE-FILE instead of a CL-SOURCE-FILE.

You might also want to add an implicit DEPENDS-ON to MAXIMA for this
system type.

I think that should give you what you need to find more info in the manual.

If there's something missing from the manual that you find you need to
do, please post a ticket to ASDF on launchpad.net so that we can make
necessary improvements to the manual.

Best,
r






More information about the asdf-devel mailing list