comp.lang.ada
 help / color / mirror / Atom feed
* ******************  Ada vs C++ Help  ********************
@ 1996-08-30  0:00 Sarner-BA-MD
  1996-08-30  0:00 ` Adam Beneschan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sarner-BA-MD @ 1996-08-30  0:00 UTC (permalink / raw)





Hello,  

Does anyone know of some good papers comparing Ada 95 to C++.  Would
especially be interested in any studies involving the comparison of
executables of similiar code modules in Ada95 and C++, ie size of .exe
and execution speed and how the code itself was fairly constructed to
be considered comparable to each other.   I am on a project that is
being developed in C with tentative plans to go to Ada.  It is a
government project that may fall under the "Ada mandate".  However,
many of the contractors seem to have a definite *dislike* for Ada.  At
650KSLOC, any Ada conversion will surely cost $$.  They would rather
transition to C++.  Probably because they could then recompile it and
call it that but also since C++ does support OO (the official party
line).  

I do not know Ada 95 (will undergo training on it next month - better
late than never...:(( ).  

Question: Does Ada 95 implement virtual functions?  If so, can these
funtions be called with access types?  I assume Ada 95 has Class
hierarchies with Inheritance, unlike 83.

Also, I have seen posts here saying C and C++ depend on pointer
arithmetic.  Could someone please elaborate on this and why it is
considered to be "dangerous" or otherwise bad?  I could sure use some
Ada ammo!  

Lastly, any suggetions for a good Ada95 book?  Would like a book
focusing on the *new* features in Ada95 and how they implement OO.

Thanks a lot for any help.

Dirk  

**********************************************************************
Dirk Sarner
Software Engineering Directorate
USA Missile Command
Redstone Arsenal, Al 35898
Email: Sarner-BA-MD@PATRIOT-ccmail.SED.Redstone.Army.Mil
Voice: 205-876-7883
FAX:   205-876-0253   
**********************************************************************
 
"An expert is a man who has made all the mistakes, which can be made,
in a very narrow field." Bohr, Niels Henrik David (1885-1962)


   






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

* Re: ******************  Ada vs C++ Help  ********************
  1996-08-30  0:00 ****************** Ada vs C++ Help ******************** Sarner-BA-MD
@ 1996-08-30  0:00 ` Adam Beneschan
  1996-08-31  0:00   ` David C. Hoos, Sr.
  1996-08-31  0:00 ` John M. Miano
  1996-09-02  0:00 ` John Herro
  2 siblings, 1 reply; 7+ messages in thread
From: Adam Beneschan @ 1996-08-30  0:00 UTC (permalink / raw)



Sarner-BA-MD@PATRIOT-ccmail.SED.Redstone.Army.Mil writes:
 >
 >Hello,  
 >
 >Does anyone know of some good papers comparing Ada 95 to C++.  

One paper I liked: "C++??, A Critique of C++", 2nd edition, by Ian Joyner:
    ftp://ftp.brown.edu/pub/c++/C++-Critique-2ed.PS 

The same web page where I found this also links to "CONTRASTS: Ada 9X
and C++", by Edmund Schonberg:
    
    ftp://ajpo.sei.cmu.edu/public/ada9x/reports/misc/9x-cplus.txt

Unfortunately, this path no longer exists, and I can't find the
report.  Does anyone know where it migrated to?  In the process of
looking for this file, I did run across another report at
ftp://ajpo.sei.cmu.edu/public/AdaIC/docs/adacplus.txt, which might be
useful. 

Hope this helps,
                                -- Adam




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

* Re: ******************  Ada vs C++ Help  ********************
  1996-08-30  0:00 ****************** Ada vs C++ Help ******************** Sarner-BA-MD
  1996-08-30  0:00 ` Adam Beneschan
@ 1996-08-31  0:00 ` John M. Miano
  1996-09-03  0:00   ` Robert A Duff
  1996-09-02  0:00 ` John Herro
  2 siblings, 1 reply; 7+ messages in thread
From: John M. Miano @ 1996-08-31  0:00 UTC (permalink / raw)



In article <3226aa7e.7480949@news.redstone.army.mil>, Sarner-BA-MD@PATRIOT-ccmail.SED.Redstone.Army.Mil wrote:
>Does anyone know of some good papers comparing Ada 95 to C++.  Would
>especially be interested in any studies involving the comparison of
>executables of similiar code modules in Ada95 and C++, ie size of .exe
>and execution speed and how the code itself was fairly constructed to
>be considered comparable to each other.   I am on a project that is
>being developed in C with tentative plans to go to Ada.  It is a
>government project that may fall under the "Ada mandate".  However,
>many of the contractors seem to have a definite *dislike* for Ada.  At
>650KSLOC, any Ada conversion will surely cost $$.  They would rather
>transition to C++.  Probably because they could then recompile it and
>call it that but also since C++ does support OO (the official party
>line).  

1. Code size and execution speed are a function of the compiler and not the 
language.

2. In almost any technical comparison from the theoretical point of view Ada 
is going beat C++.  C++ is simply a compromise.  C++ wins in most of the 
pragmatic areas: tools and available  programmers.

>Also, I have seen posts here saying C and C++ depend on pointer
>arithmetic.  Could someone please elaborate on this and why it is
>considered to be "dangerous" or otherwise bad?  I could sure use some
>Ada ammo!  

This is not the case.  The languages do not depend upon it but many 
programmers do.  They are allow to because if the [] operator is not redefined 
then *(POINTER + X)  is equivalent to POINTER [X].  For that matter in C
A[X} and X[A} are equivalent.

If you are really careful you can write programs that are just as clear and 
correct in C++ as you can in Ada.  The problem is that C++ allows one to do 
the stupidest things imaginable and stupid things are encouraged.  I have seen 
books and articles on C programming that claim

for (ii = 0 ; ii < 10 ; ++ ii)
  * a ++ = * b ++ ;

is preferable to 

for (ii = 0 ; ii < 10 ; ++ ii)
  A [ii] = B [II] ;

because it is "more efficient".    

John


World-Wide-Web: The CB Radio of the 90's




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

* Re: ******************  Ada vs C++ Help  ********************
  1996-08-30  0:00 ` Adam Beneschan
@ 1996-08-31  0:00   ` David C. Hoos, Sr.
  0 siblings, 0 replies; 7+ messages in thread
From: David C. Hoos, Sr. @ 1996-08-31  0:00 UTC (permalink / raw)



Hi,
I believe the document to which Adam referred is this one (which does
exist):
http://sw-eng.falls-church.va.us/AdaIC/docs/flyers/text/9x-cplus.txt
Hope this helps
-- 
David C. Hoos, Sr.,
http://www.dbhwww.com
http://www.ada95.com

Adam Beneschan <adam@irvine.com> wrote in article
<50764p$t2u@krusty.irvine.com>...
> Sarner-BA-MD@PATRIOT-ccmail.SED.Redstone.Army.Mil writes:
>  >
>  >Hello,  
>  >
>  >Does anyone know of some good papers comparing Ada 95 to C++.  
> 
> One paper I liked: "C++??, A Critique of C++", 2nd edition, by Ian
Joyner:
>     ftp://ftp.brown.edu/pub/c++/C++-Critique-2ed.PS 
> 
> The same web page where I found this also links to "CONTRASTS: Ada 9X
> and C++", by Edmund Schonberg:
>     
>     ftp://ajpo.sei.cmu.edu/public/ada9x/reports/misc/9x-cplus.txt
> 
> Unfortunately, this path no longer exists, and I can't find the
> report.  Does anyone know where it migrated to?  In the process of
> looking for this file, I did run across another report at
> ftp://ajpo.sei.cmu.edu/public/AdaIC/docs/adacplus.txt, which might be
> useful. 
> 
> Hope this helps,
>                                 -- Adam
> 




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

* Re: ******************  Ada vs C++ Help  ********************
  1996-08-30  0:00 ****************** Ada vs C++ Help ******************** Sarner-BA-MD
  1996-08-30  0:00 ` Adam Beneschan
  1996-08-31  0:00 ` John M. Miano
@ 1996-09-02  0:00 ` John Herro
  1996-09-03  0:00   ` Bob Kitzberger
  2 siblings, 1 reply; 7+ messages in thread
From: John Herro @ 1996-09-02  0:00 UTC (permalink / raw)



Sarner-BA-MD@PATRIOT-ccmail.SED.Redstone.Army.Mil writes:
> Would like a book focusing on
> the *new* features in Ada95
     One thing I really like about the book RENDEZVOUS WITH ADA 95 by
David Naiditch is that all the language features new to Ada 95 are
prominently marked in the margin with "Ada 95" and an arrow pointing to
the text.
     At the Web and FTP sites below my signature is a coupon that you can
send directly to John Wiley and Sons to order the book.  (I have a very
small financial interest if you use the coupon, but no financial interest
if you get the book any other way.)
     The marking of the new Ada 95 material can be a great time saver for
those already familiar with Ada 83!
- John Herro
Software Innovations Technology
http://members.aol.com/AdaTutor
ftp://members.aol.com/AdaTutor





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

* Re: ******************  Ada vs C++ Help  ********************
  1996-09-02  0:00 ` John Herro
@ 1996-09-03  0:00   ` Bob Kitzberger
  0 siblings, 0 replies; 7+ messages in thread
From: Bob Kitzberger @ 1996-09-03  0:00 UTC (permalink / raw)



You can find a quantitative comparison of Ada83 to C
at http://www.rational.com/pst/tech_papers/c_and_ada.html

(I know the poster asked for Ada95 vs. C++, yet perhaps some lessons
can be learned from these Ada83 and C experiences).


--
Bob Kitzberger	      Rational Software Corporation       rlk@rational.com
http://www.rational.com http://www.rational.com/pst/products/testmate.html




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

* Re: ******************  Ada vs C++ Help  ********************
  1996-08-31  0:00 ` John M. Miano
@ 1996-09-03  0:00   ` Robert A Duff
  0 siblings, 0 replies; 7+ messages in thread
From: Robert A Duff @ 1996-09-03  0:00 UTC (permalink / raw)



In article <508a18$1af@mtinsc01-mgt.ops.worldnet.att.net>,
John M. Miano <miano@worldnet.att.net> wrote:
>1. Code size and execution speed are a function of the compiler and not the 
>language.

Partly true.  However, it's not very useful to someone choosing a
language, to tell them "it is theoretically possible to implement
so-and-so language efficiently".  Existing implementations are all that
matter, and anything else is vaporware.

Furthermore, language design decisions can have a strong effect on
whether it is feasible, or even possible, to generate efficient code.
For example, a dispatching function call can be done in Ada or C++ by
calling indirect through a table of pointers to functions.  It is
*possible* to do the same in Smalltalk in many (perhaps most) cases, but
it's not *feasible*, since it requires global analysis of the whole
program at link time, which is takes too long for large programs.  So
most implementations of Smalltalk use a rather slow method lookup
mechanism.  I think it's fair to blame that on the language, and not on
the implementations.

- Bob




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

end of thread, other threads:[~1996-09-03  0:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-30  0:00 ****************** Ada vs C++ Help ******************** Sarner-BA-MD
1996-08-30  0:00 ` Adam Beneschan
1996-08-31  0:00   ` David C. Hoos, Sr.
1996-08-31  0:00 ` John M. Miano
1996-09-03  0:00   ` Robert A Duff
1996-09-02  0:00 ` John Herro
1996-09-03  0:00   ` Bob Kitzberger

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