From: weg@mace.cc.purdue.edu (Eythan Weg)
Subject: Re: Weaning  myself from Matlab: is APL a viable alternative for scientific programming and signal processing?
Organization: Purdue University
	<1993Jan19.012451.9402@csi.jpl.nasa.gov>
	<WEG.93Jan19140548@mace.cc.purdue.edu> <1502@kepler1.rentec.com>
Date: Tue, 26 Jan 1993 16:52:05 GMT

In article <1502@kepler1.rentec.com> andrew@rentec.com (Andrew Mullhaupt) writes:

   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?
   >It seems to be very simple had I known C.  The components are there,
   >free, as I am told by this group.  Is it not a matter of compilation
   >with few extra defintions for LinkJ?  So, where is your hacking
   >spirit?  Any volunteers?


   This may require a little more than ability to program in C. The best
   widely available code for numerical linear algebra is in FORTRAN, and
   it is quite possible to add these as linked routines to J, but this is
   not really the desired effect. What is presumably a better goal is to
   integrate these functions into J in a way sensible to J, (if possible).

   For example, matrix division is a very useful way of using a least
   squares algorithm from within APl, but not an ideal way. Often, it would
   be nice to have the QR decomposition itself, or the SVD. The point here is
   that lots of numerical linear algebra comes in functions with more than
   one input and output - often the outputs have structure. This means
   thinking through the numerical linear algebra _and_ the useful ways of
   manipulating the result structures.

   Another issue is the transpose/performance issue derived from the column
   major orientation of FORTRAN. It is trivial to transpose (out of place)
   the inputs and outputs of all arguments to the outboard functions, but this
   is often a big waste of time and space. This can be tricky if you want
   to do a real nice job.

The context of the original post was Matlab saying, if I recall
correctly, that APL is powerful in expression but weak in certain
standard computing tasks.  Hence my suggestion was guided by practical
considerations. I certainly agree that integration of a new feature
into the language should be in the latter spirit.  But the external
facilities in J (and in particular 10!:) are provided (in my view) in
provisional manner, inviting the type of patches I suggested.  What I
mean is that there are or perhaps should be two layers in J: the
cannonized (blessed by ISI) and the more opportunistic or
cannibalistic.

As for the rows vs. columns issue, if the implementor cares enough
she/he would be more careful in translating.  After all the two
representations are isomorphic.

   And no. I don't volunteer.

This is really too bad.  From your posting history I would have
thought, a contribution on your part would be a tasty piece of cake.


In article <1993Jan20.160000.10660@Princeton.EDU> bathurst@phoenix.Princeton.EDU (Bruce Bathurst) writes:

   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.

Correct.  But then again familiarity with an environment has some
influence in the choice of language.  If your problem does not require
state of the art execution speed, or is not too esoteric, requiring
special tools then you are justifyably tempted to work with the
familiar.  
   .
   .
   .
   .
   ........
   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.)

I am not sure I got your exact point here, but here are my anecdotes
in the hope they are related.  The other day I have generated some
data that was later mailed after *written* into a file.  I wished I
could have filtered it through `mail'.  We read and write but do not
pipe.  Is this an instance of the J's insulation?  Here is another
example.  I needed to provide a facility to allow people to interact
through terminals.  I had to do it through sockets.  J could not be
used just for this reason.  I noticed that Perl inserted just about
anything you want to do in the system from within (Perl) itself.  Can
this be done through 10!: ?  And here is another one.  There is no
regular expression matching in J.  I am sure other people can provide
their own examples.  I would like to be convinced that my views are
really nonsense, inherently worthless...



Eythan
Newsgroups: comp.lang.apl