axiom-mail
[Top][All Lists]
Advanced

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

Re: [Axiom-mail] Aldor compatibility


From: Stephen Wilson
Subject: Re: [Axiom-mail] Aldor compatibility
Date: Tue, 21 Sep 2004 01:05:22 -0400
User-agent: Mutt/1.4.2i

Hello,

> I think that this is the right way to go.  Unfortunately linking the
> runtime probably reproduces unnecessarily a lot of the routines in
> axiom.  You also loose aldor native compilation and speed.  

The Aldor runtime probably does mirror some of the Axiom mechanisms,
though from my understanding the worlds are quite separate, and from a
practical standpoint are mutually exclusive (If I'm wrong here I'm
sure I will be corrected). 

The only way I know how to measure the performance hit would be to
cook up some benchmarks and collect some statistics. 


> On the other hand you **theoretically** gain all of axiom functions:
> have you tried adding a call to an axiom function to your program?
> For example, how would you write in aldor a function to evaluate
> besselJ(1,1), compile it using the above procedure and run it under
> axiom? Maybe this is the nontrivial case.


Well yes, you do have access to Axiom from Aldor via the Foreign Lisp
interface. Your right that it is the nontrivial case. I'll give a
short example as to how (your questions have rekindled my own
interest in figuring this sort of thing out).

If you have not already, perhaps you might like to read
axiom/src/doc/DeveloperNotes.dvi.

>From Axiom:

     (1) -> besselJ(1,1)
     besselJ(1,1)

     (1)  0.4400505857449335
                                                            Type: DoubleFloat
     (2) -> bess: (DFLOAT, DFLOAT) -> DFLOAT := besselJ
     bess: (DFLOAT, DFLOAT) -> DFLOAT := besselJ

     (1)  theMap(DFSFUN;besselJ;3Df;8,819)
                             Type: ((DoubleFloat,DoubleFloat) -> DoubleFloat)
                                                            

theMap() above gives the Lisp name of the compiled besselJ function,
namely |DFSFUN;besselJ;3Df;8|. It is in the BOOT lisp package.

We can write the following aldor code:

   #include "axllib"

   import {
      BOOT_:_:DFSFUN_;besselJ_;3Df_;8: (DoubleFloat, DoubleFloat, Pointer) -> 
DoubleFloat;
   } from Foreign Lisp;


   wrapBessel(a: DoubleFloat, b: DoubleFloat): DoubleFloat == 
      BOOT_:_:DFSFUN_;besselJ_;3Df_;8(a, b, nil$Pointer);

If you compile and load this code as I described in the previous email
you can call `wrapBessel' from Axiom. 

Note that in calling |DFSFUN_;besselJ_;3Df_;8| from wrapBessel we are
supplying an extra argument which I rather arbitrarily defined as
having type Pointer. This is a hidden argument which all Axiom lisp
functions accept and is used, AFAIK, to pass a closure to the
function (i.e. `hidden' domain variables). How to use this extra
argument to good effect from Aldor is unknown to me. 

This is a messy but possibly necessary technique in getting the effect
you asked about. 
  
> Unfortunately I believe that aldor people have no interest in axiom
> compatibility, mostly because of their ties with maple.  Also, I
> remember having read at www.aldor.org that one of their goals or
> projects was to rewrite the remaining axiom libraries in aldor.  So it
> probably is up to axiom people to export or make available their system
> to aldor users, if it proves of any use.


There is definitely a relationship between Maple and the Aldor
folks. I am unaware of any current effort to rewrite the Axiom algebra
in Aldor. 

Aldor is a nice language, but the compiler is not as stable as one
might like. I am of the opinion that Axiom is a more mature piece of
software. As an open source system, I feel Axiom is likely to offer in
time all the features which give Aldor its raison d'etra, and more.


Again, I hope the above is useful to you. 


Sincerely,
Steve




reply via email to

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