[Top][All Lists]

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

Re: [Axiom-developer] Re: libaxiom.a

From: root
Subject: Re: [Axiom-developer] Re: libaxiom.a
Date: Tue, 21 Mar 2006 12:20:38 -0500

> > There have been numerous attempts by many people to create
> > a standalone version of the AXIOMsys library. All have
> > failed because the libraries assume lisp. I suppose you
> > could figure out a way to link GUILE into the aldor
> > libraries and succeed thru that path.
> I cannot see any clear reason to prefer GUILE or even Scheme
> over Lisp or even FOAM (the Aldor abstract machine). Also it
> seems rather "narrow minded" to think that "standalone"
> necessarily means the same thing as "without lisp"... ;)

Greenspun's Tenth Rule:

Any sufficiently complicated C or Fortran program contains an ad hoc,
informally specified, bug-ridden, slow implementation of half of
Common Lisp.

Here known as the motto of the narrow minded :-)

All of these algorithms assume underlying data structures. 
All of these data structures are efficiently coded in lisp
and optimized for the type of access. All of these data
structures use memory efficiently. 

Can you do this in C? Obviously since GCL is written in C.

Can you do this without implementing half of Common Lisp in an ad hoc,
informally specified, bug-ridden, slow implementation? Nope. Years of
research have gone into the internals of Common Lisp systems. It seems
a bit much to expect a single programmer to duplicate the task in a
single standalone program and get it right, let alone get it efficient
and bug free.

Further, you'll notice that can dynamically create and compile
functions which argues that the compiler must live within the
standalone image.

> That's like saying that "stand alone" Fortran doesn't make
> sense without the IBM 360 or that "C" is of no value without
> Unix. That is clearly incorrect. As leading-edge compilers,
> both SPAD and Aldor represent a great deal of value on their
> own - whether they are used to write Axiom library code or
> not.

No, you misinterpret what I wrote. Compilers are not libraries.
Compilers are only a small part of what you think of as "C".
It's the libraries that make C useful.

Aldor is a compiler and, without libraries, is only an interesting
demonstration of some techniques such as post-facto extensions.
My argument is that Aldor is not very interesting without a strong
library. The fundamental differences between spad and aldor are
quite small.

There are 90-some "library" computer algebra systems around.
Every one of them will do polynomial arithmetic, almost all of
them using a nice hierarchy with operator overloading, etc.
Few of them are used by anyone but their authors. 

The Axiom libraries took many, many years to build and they depend
on an underlying common lisp. To use them standalone you necessarily
have to duplicate the lisp functions.

If you really want to think about the world from the compiler viewpoint
then consider that GCL is just a large library of C code that gets
linked with your Aldor code and the Axiom library code. The AXIOMsys
image does all of this linking and saves a standalone image.

> What would you suggest might be the minimal GCL environment
> required to run most of the Axiom library code? Assuming that
> we do not want to keep any of the Axiom interpreter but just
> the minimum support for SPAD and/or the Aldor interface,
> would it be a good idea to start with BOOTSYS or something
> earlier in the bootstrap cycle? How much work would it be
> to determine exactly what modules are required? And
> realistically, how much memory are we likely to save in
> the resulting "standalone" executable but dropping all
> the stuff that we don't need?

Well, BOOTsys can clearly disappear :-)

You'll notice that I've already done this analysis. There are two 
indications. First, you'll notice that some domains are pre-loaded
into the AXIOMsys image. These are the most frequently referenced 
domains. Second, you'll see that certain lisp routines are autoloaded
only when asked (the autoload subdirectory). Any routine that is not
commonly referenced is already out of the image.

If you start up an AXIOMsys and "warm it up" by doing the kind of 
computations you want so that it won't have to load any more libraries
then you can just drop into lisp and do a (save-system) call and you
have "compiled, linked, and saved" a special purpose standalone program
to do your task. What could be easier?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]