[Top][All Lists]

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

RE: [Axiom-developer] CAS for the masses

From: Bill Page
Subject: RE: [Axiom-developer] CAS for the masses
Date: Thu, 29 Mar 2007 11:13:48 -0400

On March 29, 2007 8:32 AM Ondrej Certik wrote:
> Thanks for your explanation - I didn't know there is a
> distinction between symbolic manipulation (computation) and
> computer algebra system.  But it makes sense.

Not everyone agrees with Steven Watt about this, but I do. :-)

> I also think what can be done in Aldor can be pretty much done
> in Python and vice versa. Ralf sent me a code that he thinks
> cannot be easily rewritten in Python, but I still didn't have
> time to get through it. But as you know Python - what exactly
> can be done in Aldor that cannot be done in Python?

Well as Ralf said, it is a matter of how "easy" or "difficult"
it might be, not whether it is possible or not since both Python
and SPAD (and Aldor) are general purpose programming languages
that can, in principle given enough memory and time, be used to
implement anything that is computable.

Python lacks the concept of "category" that is essential to the
structure of the Axiom library. Categories in SPAD and Aldor are
said to be like "interfaces" in Java. Domains belong to categories
in a manner similar to the way instances (members) belong to
domains. But there are subtle differences in the 'with' inheritance
between categories, the 'has' inheritance between domains and
categories and the "add" inheritance between domains. The result
is not the same as inheritance of classes in Python which
corresponds most directly to "add" inheritance in SPAD and Aldor.
Refer to the discussion in chapter 7 of the Aldor users guide.

The Axiom library makes extensive use of categories to represent
abstract mathematical concepts, e.g. SetCategory,
FiniteFieldCategory, etc. and to support generic programming,
i.e. algorithms that can be applied to large classes of domains.
In Aldor categories are also used to represent mathematical
"axioms" or properties which are associated with Axiom domains.

On the other hand Python does directly support building classes
at run time while domains and categories can only be defined at
compile-time in Axiom. As a result it is likely that categories
can be effectively represented in Python with a little more
coding. In fact, I think that is essentially what is done in
Sage with their concept of the "parent" class that is distinct
from class inheritance (but I have not looked at this closely
enough yet).

Section 8.9.5 of the Langtangen book has a discussion of C++
style generic programming (templates) and how this can be
implemented in Python. Most of the differences and difficulties
have to do with static typing in C++, SPAD and Aldor versus the
dynamic typing of Python. In Python it is necessary to use
some form of type reflection, e.g. isinstance. Because of this
the claim is that it is diffcult (but maybe not impossible) to
write efficient generic code in the current versions of Python.

Bill Page.

reply via email to

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