[comp.lang.misc] Languages for numerical programming

poser@csli.Stanford.EDU (Bill Poser) (12/08/90)

If you numerical programming folk like Fortran because of its
facilities for handling multi-dimensional arrays and builtin complex
numbers, how come you don't use APL? APL has been around a good long time,
exists for quite a few machines, and makes Fortran's mathematical
facilities look like a joke. I'm curious as to whether the use of
Fortran rather than APL is a matter of tradition (together with the
fact that until recently APL has used a special character set - this, of
course, wouldn't have been terribly difficult to change if there had
been sufficient interest), or whether numerical programmers have
seriously considered it and rejected it. What say you?

Bill

john@ghostwheel.unm.edu (John Prentice) (12/08/90)

In article <16781@csli.Stanford.EDU> poser@csli.stanford.edu (Bill Poser) writes:
>If you numerical programming folk like Fortran because of its
>facilities for handling multi-dimensional arrays and builtin complex
>numbers, how come you don't use APL? APL has been around a good long time,
>exists for quite a few machines, and makes Fortran's mathematical
>facilities look like a joke. I'm curious as to whether the use of
>Fortran rather than APL is a matter of tradition (together with the
>fact that until recently APL has used a special character set - this, of
>course, wouldn't have been terribly difficult to change if there had
>been sufficient interest), or whether numerical programmers have
>seriously considered it and rejected it. What say you?
>

I expect few scientists have been exposed to APL, so if you want to say
they use Fortran instead of APL because of tradition, probably to a
certain extent.  However, one of the major advantages of Fortran is
its standardization and portability, something that I expect APL is
lacking in.  Beyond that, I don't have a good answer because I don't
know hardly anything about APL.  Is this something we should be looking
at?

John Prentice
john@unmfys.unm.edu

brnstnd@kramden.acf.nyu.edu (Dan Bernstein) (12/10/90)

In article <16781@csli.Stanford.EDU> poser@csli.stanford.edu (Bill Poser) writes:
> I'm curious as to whether the use of
> Fortran rather than APL is a matter of tradition (together with the
> fact that until recently APL has used a special character set - this, of
> course, wouldn't have been terribly difficult to change if there had
> been sufficient interest), or whether numerical programmers have
> seriously considered it and rejected it.

APL is unreadable. The character set isn't a problem for writing code
(DM terminals are common enough), but it's a problem for reading code.
APL has abominations like ``a**b'' to represent ``a to the bth power''.
Uh, wait a minute, maybe not that one, but you get the idea.

:-)

Seriously, APL has the same problem as Ada: it's too big. By the time
you learn how to multiply matrices in APL, you can write a complete
matrix-manipulation package in Fortran or any other language. The
plethora of unusual notations in APL is just a symptom of this problem.

---Dan

ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) (12/10/90)

In article <1990Dec7.215050.5689@ariel.unm.edu>, john@ghostwheel.unm.edu (John Prentice) writes:
> However, one of the major advantages of Fortran is
> its standardization and portability, something that I expect APL is
> lacking in.

There is an APL standard.  There is a "transfer" standard for APL
workspaces.  APL exists for PCs, Macs, /370s, others; check APL Quote Quad
and comp.lang.apl.  Put it this way, with APL around, calling Fortran a
"formula translator" and saying how natural it is is a sick joke.  (Oh
yes, modern APL includes complex.)

For numerical stuff, "design or develop in APL, recode in Fortran" makes
a lot of sense.

-- 
The Marxists have merely _interpreted_ Marxism in various ways;
the point, however, is to _change_ it.		-- R. Hochhuth.

ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) (12/10/90)

In article <1158:Dec923:58:0490@kramden.acf.nyu.edu>, brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
> Seriously, APL has the same problem as Ada: it's too big.

Odd.  The APL reference card I used to have fitted everything I needed
to know on two side of an A4 sheet.

> By the time
> you learn how to multiply matrices in APL, you can write a complete
> matrix-manipulation package in Fortran or any other language.

BEGIN lesson.
    Suppose you want to multiply B and C and put the result in A.
    For ELEMENTWISE multiplication:
	A <- B x C
	(<- is the left arrow character and x is "times"; any binary
	operator will work like this.)
    For MATRIX multiplication:
	A <- B +.x C
    ("+.x" is three characters: "plus dot times".  You can put together
    other kinds of multiplication such as "min dot max".)
    You use the same notation for integer, float, and complex, and
    for scalars, vectors, matrices, ... 
    There's more, but that'll get you started.
END lesson.

If you can write a complete matrix-manipulation package in Fortran in
the time it took to read that, you're *really* good.  If you can do it
in COBOL in that time, you are superhumanly good.

Of course I'll grant you that people _are_ confused by a language which
uses so many mathematical symbols...

-- 
The Marxists have merely _interpreted_ Marxism in various ways;
the point, however, is to _change_ it.		-- R. Hochhuth.

john@ghostwheel.unm.edu (John Prentice) (12/11/90)

In article <4473@goanna.cs.rmit.oz.au> ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) writes:
>
>For numerical stuff, "design or develop in APL, recode in Fortran" makes
>a lot of sense.
>

As I said originally, I don't know anything about APL so I will accept 
your opinion on APL versus Fortran.  However, I do doubt that developing in
one language and recoding into another is a good idea as a rule.  It might
work for small applications, but often our algorithm development codes
are themselves huge.

John

mroussel@alchemy.chem.utoronto.ca (Marc Roussel) (12/12/90)

In article <16781@csli.Stanford.EDU> poser@csli.stanford.edu (Bill Poser)
writes:
>If you numerical programming folk like Fortran because of its
>facilities for handling multi-dimensional arrays and builtin complex
>numbers, how come you don't use APL? APL has been around a good long time,
>exists for quite a few machines, and makes Fortran's mathematical
>facilities look like a joke. I'm curious as to whether the use of
>Fortran rather than APL is a matter of tradition (together with the
>fact that until recently APL has used a special character set - this, of
>course, wouldn't have been terribly difficult to change if there had
>been sufficient interest), or whether numerical programmers have
>seriously considered it and rejected it. What say you?

     I'll admit that it's been a long time since I've played with APL and
that even when I had a chance to do so, I didn't really get into it.
The impression that I was left with however is that APL is better suited
as a sort of "desk calculator" language (for testing ideas) than as a
production language.  Has this changed?  I don't remember for instance
that APL had much in the way of control structures.  (Yes, yes, I know
that Fortran isn't terribly impressive in this respect either.)  I also
remember that it was very easy to write short programs in APL that made
lots of sense as you were typing them in, but that five minutes later it
was just about impossible to make any sense of what you'd done.  (I
think that the funny character set was as much of a problem as anything
else here.)  Finally, the APL I used was interpreted.  Are there APL
compilers?  What's the state of the art in APL?

				Marc R. Roussel
                                mroussel@alchemy.chem.utoronto.ca