From METCALF@crnvma.cern.ch Mon Mar  7 09:52:25 1994
Received: from vm.uni-c.dk by dkuug.dk with SMTP id AA27848
  (5.65c8/IDA-1.4.4j for <sc22wg5@DKUUG.DK>); Mon, 7 Mar 1994 09:52:25 +0100
Message-Id: <199403070852.AA27848@dkuug.dk>
Received: from vm.uni-c.dk by vm.uni-c.dk (IBM VM SMTP V2R2) with BSMTP id 3412;
   Mon, 07 Mar 94 09:50:55 DNT
Received: from CERNVM.CERN.CH by vm.uni-c.dk (Mailer R2.07) with BSMTP id 1606;
 Mon, 07 Mar 94 09:50:51 DNT
Received: from CERNVM.CERN.CH (NJE origin METCALF@CERNVM) by CERNVM.CERN.CH
 (LMail V1.1d/1.7f) with BSMTP id 4630; Mon, 7 Mar 1994 09:50:40 +0100
Date:         Mon, 07 Mar 94 09:45:10 WET
From: Michael Metcalf <METCALF@crnvma.cern.ch>
Subject:      Stampede to C++??
To: sc22wg5@dkuug.dk
X-Charset: ASCII
X-Char-Esc: 29

We hear a lot about the inroads C++ is making, so I tried to assess what
is really happenning by putting the following request onto comp.lang.c++:

   As part of our investigation of languages for future use at CERN,
we are interested in discovering whether there is any significant
experience in the use of C++ for scientific programming. In particular,
we would like to hear (by e-mail) from anyone who has worked on a program
that fulfills the following conditions:

        i) is written entirely in C++ (i.e. no calls to Fortran
           kernels);

       ii) uses extensively C++ features (i.e. is not simply C compiled
           using a C++ compiler);

      iii) has produced published results (i.e. is not just a prototype);

       iv) is at least 10,000 lines long.

I received exactly two replies (below), only one of which is a solid long-term
application. What conclusions can we draw?

                         Regards,
                                 Mike
======================================================================== 52

    My first project in C++ falls a little bit short of your criteria
ii) and iv) but it did produce publishable results.  Now that I think of
it, it was quite a feat to get that large of a C++ program to work
and still get my results out in time to present at a conference.  The
program determined the optimum pair of materials and layer spacings for
multilayer x-ray mirrors for any given wavelength and angle of incidence.
It ran for 49 hours on my 16MHz PC to complete one design, and it had a
wild pointer in it that I didn't discover until later (my results were
valid - I got lucky).

    You might want to contact Jack Dongarra (dongarra@cs.utk.edu) who
is writing a C++ version of LAPack (LAPack++).  It will use the Fortran
BLAS3 library, but all higher level programming is done in C++.  I believe
this is the right approach to take because it is undesireable to have
more than one version of source code to maintain for a library.  I don't
think he would be doing this unless he believed that there were important
benefits to be had by using C++.

    There are two other languages you should probably also consider:
Sather and Eiffel.  Sather is described in an article in the Oct. 1993
Dr. Dobbs Journal.  It is freely available.  Sather is an optimized subset
of Eiffel.  I've had my doubts about Eiffel, but Robert Howard
(rock@tower.com), the
chairman of the Eiffel committee, recently said that the problems with
numeric computing in Eiffel have been addressed (at least partially).

    Dean Schulze

======================================================================== 79

A consortium of 7 different radio astronomy observatories from around
the world is building a system for processing radio astronomy data
that is written in c++. This package, called aips++ (astronomical
image processing system, incremented by 1) will replace an older
'classic' aips that was written in FORTRAN 66 (ugh!). There are a few
low-level fortran components in this package (FFTs, BLAS, and so on)
but probably more than 95 % of the package is written in c++, and
the applications developer will never use FORTRAN.

Advantages of c++ : once you get your object 'right', the development
of applications should be much easier because your class libraries
will contain classes which accurately reflect your 'world'.

However there is no free lunch, because defining the right classes
can be a long and complicated process. The aips++ project was
started at the beginning of 1992, and we will only be releasing
our first 'beta' version with working applications to astronomers
at the end of this year. Astronomers and developers at the different
observatories had difficulties on agreeing on uniform definitions
of classes.

Also, c++ is a complex language; compiler writers are having
trouble producing compilers which can produce reasonable sized
executables, allow you to debug, etc. Templates are the main problem;
compilers seem to have trouble producing specific instantiations
and compilation, in the worse case, can take hours. Most of the
aips++ development has taken place with Sun workstations
and we have been able to develop some custom scripts to help
cut down on the compile time. However problems do remain - last week
I created an executable which was 45 Mb in size!

Despite some teething problems with c++, I think object-orientation
is definitely the way to go. Once you have a good class library
it is definitely quicker to develop applications. There do remain questions
about the speed of c++ applications relative to FORTRAN, and as I indicated
above, we intend to leave the necessary hooks in place in aips++
to let it call FORTRAN for serious number crunching.

If you are interested you can ftp an early release of the aips++ library
from aips2.cv.nrao.edu in /pub/aips++/RELEASED/libaips-3

Tony Willis
