[Top][All Lists]

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

Re: [Axiom-developer] APL, J, and Axiom documentation

From: root
Subject: Re: [Axiom-developer] APL, J, and Axiom documentation
Date: Tue, 3 Jun 2008 19:35:20 -0400

>This seems like a bizarre idea to me.  Why would you document one program
>with another program?  Who's to say the J program is correct?  This would

far be it from me to propose a bizarre idea :-)

>1) You have to code everything twice, with the second implementation in a
>very obscure language.

Yes, it does involve coding everything twice, in wildly different
languages. Consider it a feature.

>2) You need to verify that both implementations are correct.  How can we
>ever guarantee that?

Since J/APL is executable the verification would involve testing the
results of one program against the results of the other.

>3) You need to learn an obscure language which is understood by almost

Hopefully, you're not referring to Spad :-). Yes, it does involve
learning a second language. APL is a language focused on thinking
in a very math-like notation rather than programming linearly.

>If I wanted to learn something about the implementation of the BesselJ
>function, seeing this would mean nothing to me.
>> BesselJ=: 1 : '(i.0) H. (1+m.)@(_0.25&*)@*: * ^&address@hidden: % (!m.)"_'
>> J0=: 0 BesselJ
>> j1=: 1 BesselJ

Sorry, I'll try to be a bit more concise next time :-)

>Since the documentation for the program contains another program, doesn't
>that program need to be documented too?  Also, using J baffles me.  APL is
>known for being very concise, but nearly unreadable.  Why would that help

Actually the J program would be a small part of the planned
documentation.  If you look in src/algebra/special.spad.pamphlet you
can see the recent implementation of the exponential integral and the
associated documentation.

>I must admit, I just don't get this idea.  Can you enlighten me?

J/APL has advantage of forcing you to think about the solution to
a problem in a completely orthogonal way to the usual programming
paradigms. In my experience the "re-expression" of an idea in a
second, very different form dramatically highlights the design
decisions made in the first form. Since the original authors are
no longer available we need to tease out the design decisions.

Unfortunately I'm unaware of any category or strongly typed work in J
so I don't think the idea carries much weight beyond the numerics. I
added a piecewise Gamma function to Axiom in February and have been
looking at the special functions since then. J seems to be a good fit
in this area, hence the original remark.


reply via email to

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