[Top][All Lists]

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

[Axiom-developer] Re: What is SubDomain

From: Ralf Hemmecke
Subject: [Axiom-developer] Re: What is SubDomain
Date: Mon, 13 Feb 2006 18:52:06 +0100
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050722)

Bill Page wrote:
I don't speak "BOOT" either but I am slowly learning to read it a
little. :) I agree that in the absence of any documentation, this
is quite obscure. This is the kind of "source code archaeology"
that Tim Daly has referred to in the past. Tim has proposed re-
writing this in Lisp, but I am convinced this would only make
things worse.

To me it doesn't matter whether the code is in BOOT or LISP. BOOT is not well documented and LISP is too low-level for my taste. Why cannot all this be written in Aldor? And without tricks, please. And, of course, well documented in pamphlets.

The problem is that the Aldor compiler is still not open source. :-(
But it already comes with a primitive FOAM-interpreter. I have no idea how difficult it would be to write a new interpreter from scratch in Aldor compared to clean the old interpreter/spad-compiler code.

I think the main missing information is the specific details
about the internal representation of domains and the mechanics
of how this all works. Some of this can be deduced from another
very important module written in BOOT:

I give up on this.

Would you prefer perhaps to read this coding in Lisp? Not me.

I learned a little about this from Peter Broadbery. See


The latter is really interesting.

If I compile just with the Aldor compiler, then the SPAD
compiler is not involved.

But src/algebra/integer.spad is involved indirectly through
the Axiom library interface, I think.

That should certainly be true, but that code does not contain
a definition of SubDomain. It must be defined somewhere else and that code must live in since that is the only
data that Aldor sees from Axiom.

'' is a binary file so I can't see easily what is in
that file but I don't think there is any explicit code for
SubDomain here.

Oh. I also don't know how to read this. Does someone speak FOAM?

Rather, it seems to me that the SPAD compiler
internally implements whatever it needs to compile this primitive
construct directly to Lisp. As far as I understand it ''
provides the interface to the Axiom modules written in SPAD, so
Aldor never has to worry about the implementation of SubDomain
as such.

Oh, now I either don't understand or I am beginning to understand.

One thing is that Aldor NEVER sees SubDomain. I tried tried to write a domain similar to NNI, but using just Aldor and on the command line. That doesn't work, because Aldor complains about not knowing anything about SubDomain.

So I guess,, contains NNI as a fully built domain, but does not contain SubDomain. Is there someone who knows?

Aldor, in a sense, is a more "primitive" compiler than SPAD,
i.e. with fewer things built-in and more of "SPAD" actually
coded in Aldor.

Right. That is the reason why it is actually easy to learn Aldor. There are only a few language constructs that you have
to remember. It is much harder to learn what is available
through libraries. Unfortunately, there are several libraries
around and except that builds upon,
there are many incompatibilities between libaxiom and

In Axiom I think we only get to use libaxiom. Using the Aldor
native library would be very complicated because of differing
internal implementations. Right?

The Axiom algebra code must be put into proper pamphlets anyway. It should be translated into Aldor. So way not taking the libalgebra sources of Aldor? That spares some rewriting of the code. Don't believe that it is so simple to translate SPAD into Aldor. I somehow think it would be cleaner to start building from existing Aldor libraries. Having for a while two branches while adding code from Axiom to the Aldor libraries. That is a lot of work, but I would feel better concerning the foundations of the domains and categories in Axiom.

What I really don't like is that in Axiom sometimes information is added by the compiler/interpreter which does not exist in the .spad file itself. Type information that is guessed by the compiler is just an example.

Since SubDomain is not clearly defined, nobody will be able to
use it properly except those few people who know about its semantics. For all the others it is guesswork and that totally
contradicts the goal of Axiom to support a clear type hierarchy.

I agree. This seems to be something that should be corrected.
Perhaps, because it is actually so little used, it could even
discarded all together. Maybe this was the strategy taken when
Aldor was designed?

Well, I was not a designer of Aldor, but I appreciate that SubDomain is not built into the compiler.

I think it should be possible to implement NNI (NonNegative
Integer) and PI (Positive Integer) without the use of SubDomain.
Maybe just an import of Integer would do? I do not know of any
specific case where the knowledge that NNI and PI are "subdomains"
of Integer is actually used.

Oh, that is a good suggestion. But maybe some code relies on elements being NNI or PI. To find this out, one can only go by hand through all the tons of code lines. :-( So it cannot be discarded immediately.

But when transferring to Aldor, one has to decide anyway what to do.

Anyway, I don't see need for a constructor SubDomain. What could be achieved by the SubDomain constructor, can easily be done using ordinary Aldor syntax.


reply via email to

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