Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is PL/I suitable for scientific computing ?

0 views
Skip to first unread message

John R. Myers

unread,
Jan 21, 1996, 3:00:00 AM1/21/96
to
Joachim Linn [ET] (li...@rhrk.uni-kl.de) wrote:
: I ... am interested in the question whether PL/I is suitable
: for scientific computing, ...

My experience is with software to support telecommunications network
planning and analysis--this probably counts as "scientific" although
there's a lot of data handling involved. Over the years it has seemed
to me that the PL/1 teams could deliver usable results sooner than
Fortran or C-language teams with a similar mix of skills. (Not all
the members of a team would be expert programmers, however the
problem-domain experts would be expected to contribute to the
programming effort.)

PL/1 has the advantage of strong type checking across subroutine calls
and array bounds checking. Use these features--they really make a
difference on multi-programmer projects.

PL/1 has one serious disadvantage for scientific computing--the default
use of fixed precision intermediate targets to evaluate expressions like:

X = 0.000001 * 0.000001 * 1000000000000.0;

This problem comes up repeatedly when working in engineering units and
in grinding out series approximations to functions. It can cause a
serious loss of precision with absolutely no warning. Make sure that
every programmer is trained to use a coding style like this:

Z = FLOAT(1.0) / (FLOAT(2.0) * FLOAT(3.141592) * F * C);

Disclaimer: I abandoned PL/1 as a development language ten years ago
due to the unrealistic pricing of the mainframe systems that supported
PL/1, so I don't have any experience with the newer compilers.
--

John R. Myers <jmy...@netcom.com> / Menlo Park, California
"This posting conforms in every respect to the official
written policies of my employer."

++ robin

unread,
Jan 22, 1996, 3:00:00 AM1/22/96
to
li...@rhrk.uni-kl.de (Joachim Linn [ET]) writes:

>Hello PL/I programmers,

>I (as a non PL/I user) am interested in the question whether PL/I is suitable
>for scientific computing, and how it compares to Fortran or C with respect to
>this.

>Regards, Joachim Linn

---PL/I was designed for scientific computing (as well as for
commercial and system programming, etc).

And it does it very well indeed.

Do you have access to these texts (which look at engineering
applications)?

D.R. Stoutemyer, PL/I for Engineering & Science, Prentice-Hall;
C.T. Fike, PL/I for Scientific Programmers, Prentice-Hall;
G.F. Groner, PL/I Programming in Technological Applications, Books
on Demand;
A Vasonyi, Problem Soving by Digital Computers with PL/I, Prentice-Hall.
PL/I always handled engineering problems better than other languages
because it handles I/O better, in a straight-forward way, and
because it handles arrays in the way in which engineers and
mathematicians think -- that is, by rows. You can write some
statements involving arrays simply (because PL/I provides whole
array operations and cross-sections of arrays).

With its excellent error-handling system, programs can tell
you what's wrong (ever had to find an error in a 10,000 line
Fortran program that just gives a cryptic message "overflow" but
doesn't tell you where?

++ robin

unread,
Jan 22, 1996, 3:00:00 AM1/22/96
to
jmy...@netcom.com (John R. Myers) writes:

>Joachim Linn [ET] (li...@rhrk.uni-kl.de) wrote:
>: I ... am interested in the question whether PL/I is suitable
>: for scientific computing, ...

>My experience is with software to support telecommunications network
>planning and analysis--this probably counts as "scientific" although
>there's a lot of data handling involved. Over the years it has seemed
>to me that the PL/1 teams could deliver usable results sooner than
>Fortran or C-language teams with a similar mix of skills. (Not all
>the members of a team would be expert programmers, however the
>problem-domain experts would be expected to contribute to the
>programming effort.)

>PL/1 has the advantage of strong type checking across subroutine calls
>and array bounds checking. Use these features--they really make a
>difference on multi-programmer projects.

>PL/1 has one serious disadvantage for scientific computing--the default
>use of fixed precision intermediate targets to evaluate expressions like:

> X = 0.000001 * 0.000001 * 1000000000000.0;

>This problem comes up repeatedly when working in engineering units and
>in grinding out series approximations to functions. It can cause a
>serious loss of precision with absolutely no warning.

---For the above statement, you get *much more* than a warning.
At run time, you get a fixed-point overflow (which is a fatal error).
Of course, you need to have fixed-point overflow enabled.

>Make sure that
>every programmer is trained to use a coding style like this:

> Z = FLOAT(1.0) / (FLOAT(2.0) * FLOAT(3.141592) * F * C);

---Or you can write Z = 1/2*3.14159e0*F*C; which is a lot cleaner.
Or even Z = 3.14159e0/2*F*C; which is even better!
If you put e0 after constants, you won't go too far wrong.

PL/I provides some data types that are not provided by other
languages (apart from COBOL). In particular, if you have been
using Fortran, one are not be aware of the needs of fixed-point working
(with decimal fixed-point, that is). Fortran't REAL constants
(1.5, 10.3 etc) are treated by PL/I as fixed-point decimal,
not as floating-point. Just put e0 after each constant that
you want to be floating-point. Also, write it out to 6 figures.

You have to watch out for 1/2 and 1/3 in Fortran (which gives
you 0 precisely). In PL/I, you get 0.5 and 0.33333333333...
respectively.

In short, There is not a "serious disadvantage" in using PL/I for solving
engineering problems. It is an excellent language for doing just that task.

There are, however, serious advantages in using PL/I, because the
facilities that it offers are so rich.

>Disclaimer: I abandoned PL/1 as a development language ten years ago
>due to the unrealistic pricing of the mainframe systems that supported
>PL/1, so I don't have any experience with the newer compilers.

---The PC version is very moderately priced. Why not try out PL/I for OS/2?

Dave Jones

unread,
Jan 22, 1996, 3:00:00 AM1/22/96
to
Hi, Joachim.

> >Joachim Linn [ET] (li...@rhrk.uni-kl.de) wrote:
> >: I ... am interested in the question whether PL/I is suitable
> >: for scientific computing, ...
>

PL/I is *very suitable* for scientific computing tasks. Two good books
on using PL/I in scientific/technical applications are: "PL/I for Scientific
Programmers" by C. T. Fike and "PL/I Programming in Technological
Applications: by G. Groner. The recently published book by this newsgroup's
founder, Robin Vowels, "Introduction to PL/I, Algorithms, and Structured
Programming" also has much material on using PL/I to solve scientific
problems -- things like programming the Fast Fourier Transform algorithm
in PL/I, inversion of banded matrices, etc. There's also a complete
chapter on the PL/I COMPLEX data attribute for performing complex arthmetic
-- C lacks this very important scientific computing data type, thereby
forcing the programmer to do much of the hard work himself.

I've used PL/I (and Fortran, and many other languages, as well) in my
20+ years as a geophysicist and I've been very pleased with it. It's fast,
easy to write and maintain, directly supports the necessary data types
and program constructs needed in this type of work, and is portable across
a wide varity of platforms -- much more so that C and even Fortran, in
many cases. Eberhard Sturm's PL/I vs C paper that has been mentioned here in
this forum several times is based on his experiences in using both PL/I
and C in a scientific environment and he gives some very good reasons why
it makes sense to write these sorts of applications (I believe his involve
nuclear physics...) in PL/I. He's running his PL/I applications in a Unix
environment (IBM's AIX, I think) where much of today's scientific work
takes place.

Dave Jones
Velocity Software

Message has been deleted
0 new messages