Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!spool.mu.edu!uwm.edu!linac!att!att!dptg!ulysses!allegra!princeton!phoenix.Princeton.EDU!bathurst
From: bathurst@phoenix.Princeton.EDU (Bruce Bathurst)
Subject: Re: Weaning  myself from Matlab: is APL a viable alternative for scientific programming and signal processing?
Message-ID: <1993Jan20.160000.10660@Princeton.EDU>
Originator: news@nimaster
Sender: news@Princeton.EDU (USENET News System)
Nntp-Posting-Host: phoenix.princeton.edu
Organization: Princeton University
References: <IBE1109.93Jan17152519@etbsun1.draper.com> <1993Jan19.012451.9402@csi.jpl.nasa.gov> <WEG.93Jan19140548@mace.cc.purdue.edu>
Date: Wed, 20 Jan 1993 16:00:00 GMT
Lines: 49

In article <WEG.93Jan19140548@mace.cc.purdue.edu>
weg@mace.cc.purdue.edu (Eythan Weg) writes:

>Can someone try to build a linear algebra (for example) version of J?

The one aspect of APL (or J) that I haven't seen mentioned in this
thread is its flexibility.  If one is dealing with a limited class of
problems, such as those described with linear algebra or linguistic
rules, there is often a language designed for those problems.  APL is
a language designed to describe more general algorithms.

Conventional mathematical notation beautifully describes algebraic and
geometric structures, and the application of logic to them; but the
notation does not uniquely describe algorithms for constructing these
objects from numbers or truth values (T or F).  (Notice the large
number of algorithms published on constructing the inner product of
two vectors.)  APL notation describes algorithms "uniquely", in terms
of operations for which numerically stable algorithms are well known.

I use APL in two ways.  When I work on new mathematical solutions to
problems in my field (metamorphic petrology), I don't know where the
mathematics will lead.  APL is then not just the language of choice;
it's the only language I can use.  (The APL can not only follow the
mathematics, the APL notation sometimes suggests the next step to
take.)

My second use of APL is to write what B. Kernighan has called "little
languages", languages designed to express and solve a limited class of
problems.  Here efficiency becomes an issue; so after writing the
prototype in APL, I sometimes replace the slower lines or functions
with links to compiled routines from NetLib.  

One way to write a "linear algebra" APL for real numbers would be to
replace the QR matrix operation with an SVD.  Easier, however, would
be to write this as a little language.  Choose a set of matrix
factorizations, and write these as (closed) functions in a workspace,
linked to compiled Fortran code.

IMO, J has not discarded the one feature impeding APL's popularity:
its intimate link with an interpretive environment from the 1960's.
APL might be seen in a better light if it were far more closely
connected to each computer's native operating system, the was AWK is
connected to UNIX and C.  (The code itself would still be portable.)

Bruce (Gypsy Scholar)
-- 
Department of Geological and Geophysical Sciences
Princeton University, Princeton, NJ 08544
bathurst@phoenix.princeton.edu bathurst@pucc.bitnet !princeton!phoenix!bathurst
