comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: Waiver question
Date: 1997/04/21
Date: 1997-04-21T00:00:00+00:00	[thread overview]
Message-ID: <EACHUS.97Apr21141820@spectre.mitre.org> (raw)
In-Reply-To: 33585385.C8D@lmtas.lmco.com


In article <33585385.C8D@lmtas.lmco.com> Ken Garlington <GarlingtonKE@lmtas.lmco.com> writes:

   >  *  Most existing DSP code is in C/C++. Therefore, reuse is easier
   >	if the new code is also written in C++.

   >    Anyone have a reason to think this waiver shouldn't be approved?

   Sure, the first quoted statement indicates the author has no clue.

   Reuse of C is much easier from Ada than from C.

   Reuse of C is much, much easier from Ada than from C++.

   Reuse of C++ is all but impossible if the code requires any other
compiler, whether for C, Ada, C++, or COBOL.  Note that this is a
compiler issue--using g++ and gcc or even g++ and gnat is
significantly easier than using a different underlying technology.

   Therefore if there is a significant amount of C++ to be reused, you
need to use one specific compiler, otherwise you are better off with
Ada 95.

    This was to some extent true with Ada 83, but with Ada 95 the
advantage of using Ada for interfacing to foreign code has
substantially improved, and not just because there exists a tool for
creating Ada package specifications from .h files.

    The real advantage from using Ada comes at link time.  If you have
two C based products you have to interface to, and they have
conflicting names in them, you are going to be climbing the wall in C
or C++.  In Ada 95 you can decide to link your program as separate
partitions, play compiler specific games in the library structure, or
actually go into one of the C programs and make changes.  That second
choice sounds confusing so watch a real example: I have two COTS C
libraries I want to use in a Windows NT environment.  I can build two
DLLs, one for the Ada binding to each COTS product, then write the
rest in Ada.  At this point I don't need to care if there are
conflicts in the C names used.  (Or it may be the case that one or
both of the DLLs are provided, and all I have to do is construct the
corresponding package spec.)

    In theory, I can do the same thing in C, or for that matter in
Visual C++, if I am very careful never to require include files from
the two COTS packages in the same C source file.  But there are other
gotchas, and I have been got several times.  For example, if the C
code for one product replaces a standard c library operation, such as
malloc, getting things to link properly can be a horror.

--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...




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

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-18  0:00 Waiver question Ken Garlington
1997-04-19  0:00 ` Tom Moran
1997-04-20  0:00 ` Dean Runzel
1997-04-22  0:00   ` Ken Garlington
1997-04-20  0:00 ` Steve Doiel
1997-04-20  0:00 ` Robert Dewar
1997-04-21  0:00   ` Ken Garlington
1997-04-22  0:00     ` Ken Garlington
1997-04-23  0:00       ` Corey Minyard
1997-04-24  0:00         ` Richard Kenner
1997-04-28  0:00         ` Larry Kilgallen
1997-04-28  0:00           ` Corey Minyard
1997-04-29  0:00             ` Kaz Kylheku
1997-04-29  0:00             ` Robert Dewar
1997-04-29  0:00             ` Laurent Guerby
1997-04-30  0:00               ` Corey Minyard
1997-04-29  0:00           ` Richard Kenner
1997-04-30  0:00             ` Robert Dewar
1997-05-01  0:00               ` Larry Kilgallen
1997-05-07  0:00                 ` Bad .diff files in gnat-3.09 in Linux Benoit Jauvin-Girard
1997-05-09  0:00                   ` Albert K. Lee
1997-04-30  0:00             ` Waiver question Robert A Duff
1997-05-01  0:00               ` Kaz Kylheku
1997-05-02  0:00                 ` Robert A Duff
1997-05-02  0:00                   ` Larry Kilgallen
1997-05-02  0:00                     ` Robert Dewar
1997-05-02  0:00                     ` Robert A Duff
1997-05-02  0:00                       ` Larry Kilgallen
1997-05-03  0:00                         ` Robert A Duff
1997-05-03  0:00                           ` Larry Kilgallen
1997-05-04  0:00                             ` Robert Dewar
1997-05-04  0:00                         ` Robert Dewar
1997-05-06  0:00                     ` John M. Mills
1997-04-29  0:00           ` Robert Dewar
1997-04-23  0:00     ` Tarjei Jensen
1997-04-21  0:00 ` Robert I. Eachus [this message]
1997-04-21  0:00   ` Robert Dewar
1997-04-22  0:00     ` Robert I. Eachus
1997-04-23  0:00       ` Robert Dewar
1997-04-22  0:00   ` Ken Garlington
1997-04-23  0:00     ` Robert S. White
1997-04-24  0:00     ` Robert Dewar
1997-04-24  0:00       ` Steve Vestal
1997-04-25  0:00         ` Ken Garlington
1997-04-25  0:00         ` Robert I. Eachus
replies disabled

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