comp.lang.ada
 help / color / mirror / Atom feed
From: rodemann@mathematik.uni-ulm.de (Joerg Rodemann)
Subject: Re: Ada vs C++
Date: 1997/09/09
Date: 1997-09-09T00:00:00+00:00	[thread overview]
Message-ID: <34150637.0@news.uni-ulm.de> (raw)
In-Reply-To: 340C47F8.670B@osc.edu



James B. White, III (Trey) (trey@osc.edu) wrote:

> The ability of C++ compilers to infer template instantiations may be
> dangerous, but it allows the construction of incredibly powerful
> interfaces. Combined with the ability to inline functions, you can write
> strange constructions called "expression templates" and "template
> metaprograms" that perform optimizations that are extremely difficult or
> impossible for a compiler to perform on its own.

> Ada may have advantages over C++, but only C++ allows these incredibly
> powerful programming techniques. Unfortunately, the techniques are also
> incredibly complicated and incredibly ugly. The resulting interface,
> however, can be elegant. For more information, see the following
> references by the inventor, Todd Veldhuizen.

I wonder how this will work on non-standard highend machines. As far as I
can see --- if all you need is 
   a) very high computational power (number crunching)
   b) use of already existing numerical libraries
   c) good support by the vendor
on such machines you most of the time are left with f77 or maybe f90 or even
HPF. Perhaps the C compiler does work properly too. If you use C++ and
desire at least a bit of portability forget about nested librarie and i.e.
templates. Template instantiation still seems to be a serious problem for
compiler writers her --- and although normal desktop machines are already
capable of get this thing right...on the highend machines I worked on this
left us with a real mess. Sure, there are workarounds available but they
neither increase readability nor are they portable at all (all those pragmas
concerning instantiation.) The more complex your templates are the more likely
is it that they will fail.

On desktop machines I think this power hunting does not make much sense. A
factor of 2 or 3 in speed is clearly serious but only if you intend to
run the code for a long time (months to years). Otherwise a gain in
shorter development time may prove much more important than anything else.
(I saw people spending weeks with number crunching just to throw away the
results because the discovered a missing - in -= or a = instead of a ==
or some similiar silly bug. (Many were related to memory leaks and faulty
vector access. Multi-dimensional arrays are not that easy in C as one would
guess. :-) ). Those template constructs seem be similarly errorprone to me.
And --- which debugger will help you there?

Sorry for my sceptical view here, it's of course just my opinion.

Yours

Joerg


--
rodemann@mathematik.uni-ulm.de | Dipl.-Phys. Joerg S. Rodemann
Phone: ++49-(0)711-5090670     | Flurstrasse 21, D-70372 Stuttgart, Germany
-------------------------------+---------------------------------------------
rodemann@rus.uni-stuttgart.de  | University of Stuttgart, Computing Center
Phone: ++49-(0)711-685-5815    | Visualization Department, Office: 0.304
Fax:   ++49-(0)711-678-7626    | Allmandring 30a, D-70550 Stuttgart, Germany





  parent reply	other threads:[~1997-09-09  0:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <md5:DB04B9CCA20E8EB6142C50D2DE055239>
     [not found] ` <34090462.4652@easystreet.com>
     [not found]   ` <Pine.SGI.3.95.970831115842.17664A-100000@shellx.best.com>
1997-09-02  0:00     ` Ada vs C++ James B. White, III (Trey)
1997-09-05  0:00       ` Robert Dewar
1997-09-05  0:00         ` Larry Kilgallen
1997-09-05  0:00         ` Brian Rogoff
1997-09-08  0:00         ` Ada vs C++ (Expression Templates) James B. White, III (Trey)
1997-09-08  0:00           ` Matthew Heaney
     [not found]       ` <Pine.SGI.3.95.970904201703.13590A-100000@shellx.best.com>
1997-09-05  0:00         ` Ada vs C++ Jon S Anthony
1997-09-08  0:00       ` Richard A. O'Keefe
1997-09-08  0:00         ` Ada vs C++ (vs Lisp) James B. White, III (Trey)
1997-09-08  0:00           ` Brian Rogoff
1997-09-09  0:00             ` Ada vs C++ (Ada 0X) James B. White, III (Trey)
1997-09-09  0:00               ` Brian Rogoff
1997-09-10  0:00               ` Ole-Hjalmar Kristensen FOU.TD/DELAB
1997-09-11  0:00                 ` Anonymous
1997-09-11  0:00                   ` Ole-Hjalmar Kristensen FOU.TD/DELAB
1997-09-09  0:00             ` Ada vs C++ (vs Lisp) Robert A Duff
1997-09-09  0:00       ` Joerg Rodemann [this message]
1997-09-09  0:00         ` Ada vs C++ (high-performance libraries) James B. White, III (Trey)
2001-07-21 16:45 Ada vs C++ Lao Xiao Hai
2001-07-23  5:39 ` Colin Paul Gloster
  -- strict thread matches above, loose matches on Subject: below --
1991-06-27 17:05 Ray Diederich, 301-869-8400
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox