comp.lang.ada
 help / color / mirror / Atom feed
* Ada vs C++
@ 1991-06-27 17:05 Ray Diederich, 301-869-8400
  0 siblings, 0 replies; 10+ messages in thread
From: Ray Diederich, 301-869-8400 @ 1991-06-27 17:05 UTC (permalink / raw)


From _Defense_&_Aerospace_Electronics_, Vol. 1, Num. 1 (June 24, 1991), a
quote from Lloyd Mosemann, deputy assistant secretary of the Air Force,
regarding the yet to be released case studies of Ada versus C++:

"Without Exception Ada won out in all categories of study," said Mosemann.
He said Ada's cost savings were 35% over C++'s, and maintenance savings
topped 70%.

(Reprinted without permission.)

Ray Diederich
**********
My employer would prefer that I had no opinions to express, especially any
that may have been expressed here.
**********

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada vs C++
       [not found]   ` <Pine.SGI.3.95.970831115842.17664A-100000@shellx.best.com>
@ 1997-09-02  0:00     ` James B. White, III (Trey)
  1997-09-05  0:00       ` Robert Dewar
                         ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: James B. White, III (Trey) @ 1997-09-02  0:00 UTC (permalink / raw)




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.

<http://monet.uwaterloo.ca/blitz/#papers>

I would love for Ada to provide the same level of power, preferably in a
more elegant and straightforward way! 
-- 
James B. White, III (Trey)
Ohio Supercomputer Center
trey@osc.edu
<http://www.osc.edu/~trey/>
Phone: (614)292-9291  Fax: (614)292-7168




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada vs C++
  1997-09-05  0:00       ` Robert Dewar
@ 1997-09-05  0:00         ` Brian Rogoff
  1997-09-05  0:00         ` Larry Kilgallen
  1 sibling, 0 replies; 10+ messages in thread
From: Brian Rogoff @ 1997-09-05  0:00 UTC (permalink / raw)



On 5 Sep 1997, Robert Dewar wrote:
<... discussion of C++ template metaprograms deleted...>

> So, we see from the above (if you believe it), that C++ is the way to
> go if you want something that is incredibly powerful, incredibly complicated
> and incredibly ugly.

Lets not forget that there are lots of other features of C++ that interact to 
make it complicated and ugly, from an Ada perspective. So the experience of C++ 
templates, while helpful, is not entirely convincing. There are some good ideas 
in C++, though I agree that this (very specific case of embedding a little 
language in the template system) is not one of them. 

> Seriously, I think this quest after "power" in languages, rather than
> basic functionality, is misguided. 

I agree that you can waste a lot of time playing with features that may seem 
powerful but may end up not being worthwhile for practical development.
However, I don't know of any good way other than experience to decide what
is "basic functionality", and even then we'll always have disagreements
(modules, MI, assertions, ...).

> An important ingrediant in achieving reliability is to keep things simple 
> at all levels.

You are the last person in the world who needs to be reminded that the concept
of "simplicity" is heavily overloaded! 

What do you think about the idea of automatically instantiating generic 
subprograms by inferring parameters but *not* values, i.e., none of this 
"template metaprogram" stuff, but a simple :-) generalization of Ada 
overloading? Any difference in perspective as a user vs as a compiler writer? 

-- Brian





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada vs C++
       [not found]       ` <Pine.SGI.3.95.970904201703.13590A-100000@shellx.best.com>
@ 1997-09-05  0:00         ` Jon S Anthony
  0 siblings, 0 replies; 10+ messages in thread
From: Jon S Anthony @ 1997-09-05  0:00 UTC (permalink / raw)




In article <Pine.SGI.3.95.970904201703.13590A-100000@shellx.best.com> Brian Rogoff <bpr@shellx.best.com> writes:

> > Ada may have advantages over C++, but only C++ allows these incredibly
> > powerful programming techniques. Unfortunately, the techniques are also
> 
> I believe you can do all of this stuff with Common Lisp macros.  

Actually, CL macros seem much more generally capable than C++
templates.  For one thing, they aren't tied to the type system.  For
another, they can avail themselves of the full capabilities of CL
(including closures).  And, I still think you could write the C++
template facility (such as it is) in CL macros as an embedded langauge
(not that this would actually be useful or worth anything - just a
demonstration).  It would likely even be relatively straightforward,
but to be fair, I haven't looked at the possibility that closely.


> automatic instantiation, but that won't be able to do what you want. What 
> *you* want seems to be macros. Most Ada-philes seem to be macro-phobic,
> but don't let that stop you. 

Right.  I'm pretty skeptical of macros (real ones ala' CL) in
something like Ada (or C++ or anything like them).  They just don't
seem to fit the spirit of the language.

/Jon
-- 
Jon Anthony
OMI, Belmont, MA 02178, 617.484.3383 
"Nightmares - Ha!  The way my life's been going lately,
 Who'd notice?"  -- Londo Mollari




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada vs C++
  1997-09-02  0:00     ` James B. White, III (Trey)
@ 1997-09-05  0:00       ` Robert Dewar
  1997-09-05  0:00         ` Brian Rogoff
  1997-09-05  0:00         ` Larry Kilgallen
       [not found]       ` <Pine.SGI.3.95.970904201703.13590A-100000@shellx.best.com>
                         ` (2 subsequent siblings)
  3 siblings, 2 replies; 10+ messages in thread
From: Robert Dewar @ 1997-09-05  0:00 UTC (permalink / raw)



James White says

<<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.>>


So, we see from the above (if you believe it), that C++ is the way to
go if you want something that is incredibly powerful, incredibly complicated
and incredibly ugly.

Sometimes ones friends are ones worst enemies :-)

Seriously, I think this quest after "power" in languages, rather than
basic functionality, is misguided. An important ingrediant in achieving
reliability is to keep things simple at all levels.

You say that you can produce wonderful interfaces with this amazing
capability. What is interesting is to look at such an interface, and
then ask how that interface would be reflected and implemented in
other languages. Specific examples typically show that such claims
are simply inflated and have little substance!





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada vs C++
  1997-09-05  0:00       ` Robert Dewar
  1997-09-05  0:00         ` Brian Rogoff
@ 1997-09-05  0:00         ` Larry Kilgallen
  1 sibling, 0 replies; 10+ messages in thread
From: Larry Kilgallen @ 1997-09-05  0:00 UTC (permalink / raw)



In article <dewar.873461400@merv>, dewar@merv.cs.nyu.edu (Robert Dewar) writes:

> James White says
>
> <<

> 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.>>

> Seriously, I think this quest after "power" in languages, rather than
> basic functionality, is misguided. An important ingrediant in achieving
> reliability is to keep things simple at all levels.

Real "power" makes it easier to shoot oneself in the foot.
With multiuser computers, one can even get the feet of neighbors.
"Power" seems the opposite of safety.

Larry Kilgallen




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada vs C++
  1997-09-02  0:00     ` James B. White, III (Trey)
  1997-09-05  0:00       ` Robert Dewar
       [not found]       ` <Pine.SGI.3.95.970904201703.13590A-100000@shellx.best.com>
@ 1997-09-08  0:00       ` Richard A. O'Keefe
  1997-09-09  0:00       ` Joerg Rodemann
  3 siblings, 0 replies; 10+ messages in thread
From: Richard A. O'Keefe @ 1997-09-08  0:00 UTC (permalink / raw)




"James B. White, III (Trey)" <trey@osc.edu> writes:
>Ada may have advantages over C++, but only C++ allows these incredibly
>powerful programming techniques.

False.  Lisp people know this kind of meta-programming as a very old
technique indeed.

-- 
Unsolicited commercial E-mail to this account is prohibited; see section 76E
of the Commonwealth Crimes Act 1914 as amended by the Crimes Legislation
Amendment Act No 108 of 1989.  Maximum penalty:  10 years in gaol.
Richard A. O'Keefe; http://www.cs.rmit.edu.au/%7Eok; RMIT Comp.Sci.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada vs C++
  1997-09-02  0:00     ` James B. White, III (Trey)
                         ` (2 preceding siblings ...)
  1997-09-08  0:00       ` Richard A. O'Keefe
@ 1997-09-09  0:00       ` Joerg Rodemann
  3 siblings, 0 replies; 10+ messages in thread
From: Joerg Rodemann @ 1997-09-09  0:00 UTC (permalink / raw)




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





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Ada vs C++
@ 2001-07-21 16:45 Lao Xiao Hai
  2001-07-23  5:39 ` Colin Paul Gloster
  0 siblings, 1 reply; 10+ messages in thread
From: Lao Xiao Hai @ 2001-07-21 16:45 UTC (permalink / raw)


There is a very interesting discussion on
comp.lang.c++.moderated regarding Ada
versus C++ for safety-critical software.
Some readers of this forum might find it
stimulating.

Richard Riehle
AdaWorks Software Engineering
richard@adaworks.com
http://www.adaworks.com





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ada vs C++
  2001-07-21 16:45 Ada vs C++ Lao Xiao Hai
@ 2001-07-23  5:39 ` Colin Paul Gloster
  0 siblings, 0 replies; 10+ messages in thread
From: Colin Paul Gloster @ 2001-07-23  5:39 UTC (permalink / raw)


Lao Xiao Hai wrote:
"There is a very interesting discussion on
comp.lang.c++.moderated regarding Ada
versus C++ for safety-critical software.
Some readers of this forum might find it
stimulating.

Richard Riehle
AdaWorks Software Engineering
richard@adaworks.com"

Thank you very much. I am a member of the Association of C &
C++ Users ( HTTP://WWW.ACCU.org/ ) and subscribe to some of its
high quality email lists but do not these days look at the newsgroups
for
C and C++ nearly as much as accu-general (the main ACCU list).

For those of you trying to find the thread Lao Xiao Hai alerted us to,
the
initial post is news:bebbba07.0107191159.47311f81@posting.google.com
timestamped 19 Jul 2001 18:40:10 -0400 and started by
18k11tm001@sneakemail.com (Russ) on news:comp.lang.c++.moderated

Regards,
Colin Paul Gloster




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2001-07-23  5:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-21 16:45 Ada vs C++ Lao Xiao Hai
2001-07-23  5:39 ` Colin Paul Gloster
     [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     ` James B. White, III (Trey)
1997-09-05  0:00       ` Robert Dewar
1997-09-05  0:00         ` Brian Rogoff
1997-09-05  0:00         ` Larry Kilgallen
     [not found]       ` <Pine.SGI.3.95.970904201703.13590A-100000@shellx.best.com>
1997-09-05  0:00         ` Jon S Anthony
1997-09-08  0:00       ` Richard A. O'Keefe
1997-09-09  0:00       ` Joerg Rodemann
  -- strict thread matches above, loose matches on Subject: below --
1991-06-27 17:05 Ray Diederich, 301-869-8400

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