comp.lang.ada
 help / color / mirror / Atom feed
From: jesup@steinmetz.steinmetz.UUCP (Randell Jesup)
Subject: Re: "C" vrs ADA
Date: Wed, 26-Aug-87 05:25:49 EDT	[thread overview]
Date: Wed Aug 26 05:25:49 1987
Message-ID: <7108@steinmetz.steinmetz.UUCP> (raw)
In-Reply-To: 36@sarin.UUCP

[ To give my comments perspective, I have been programming in ADA ]
[ professionally, in a government DARPA project.		  ]

In article <36@sarin.UUCP> eric@sarin.UUCP (Eric Beser sys admin) writes:
>In article <2231@cbmvax.UUCP>, daveh@cbmvax.UUCP (Dave Haynie) writes:
>
>> The biggest problems with Ada is the massive size of its compiler and the
>> verbosity of it's language.  I guess if you really like Pascal or Modula2,
>> you might adjust, but if you're used to C, it might take some getting used
>> to.  
>
>   Working in an industrial environment, and having used Ada, I do not see
>how the "size" of a compiler matters in producing code that is efficient,
>that is easily maintainable, and documentable. If you are used to C, you
>may have trouble adjusting to the strong typing of the language. Ada is
>a verbose language (if rich can be stated in any other words). But it is that
>richness that makes the language so useful.

	The size of the compiler DOES matter, even in an industrial 
envirionment.  The Vax Ada compiler, supposedly the best out there (according
to a well-informed source on the original panel/whatever), is one of the
things that forced us to quadruple our machines memory.  It was not the
only thing, but it was so bad we were doing batch compiles at night!
(Shades of the early 70's!)  Otherwise, we'd get 500 page faults/cpu sec.
	Concerning the efficiency of the generated code, our absract data
types and the operations on them took well over 1/2 meg, not including the
program that would use them.  By comparison, the initial quick-hacked C
version done for the phase 1 final review (in 12 man-weeks!) was about
300-400K (with a fair amount of duplicate code, like parsers in a number of
modules).  This is obviously not a very scientific comparision, but it does
show something (at least that it caused much more disk use).

>> As for where it's used, mainly DOD I'd guess.  It certainly isn't used much,
>> if any, in commercial or industrial sectors.  C's the language for most of
>> these, though your Fortran experience could come in handy in some heavy
>> duty scientific fields (most machines have Fortran compilers that code better
>> than existing C compilers, but since there's more work being done on C, I
>> wouldn't be surprised if this is changing).  Ada is certainly general purpose
>> enough to be used elsewhere if you have access to a compiler for it, and it
>> generally has alot of things built into it that you have to add to C language
>> (like tasks, exceptions, etc.).
>
>  I get irked when I hear this. This may have been true a year ago, but no
>longer. Many customers (non DOD or NATO) are requesting Ada because of the
>software engineering that it dictates. Ada is not just a computer language,
>it is a software engineering methodology. Many customers who originally
>requested C are now asking for Ada. The compilers today are becoming efficient.
>There are some imperfections however, and all is not rosy. But there are
>compilers for the 68020 that produce well optimized code. There are compilers
>for the 1750A military processor that produced adequate code, although 
>not as well optimized. Toolsets are now usable. In fact, you can buy a 
>validate Ada compiler for the IBM PC-XT (Meridian) that does not require
>extra memory, is somewhat expensive (700.00), but not the $3000.00 that
>the leading pc vendor charges.

	But how compact are the programs produced by it? And how fast?

>Let me give an example from actual experience.
>
>  I am part of a large Ada project that is building a tool for use by our
>engineers (industrial, commercial, as well as DOD contracts). After coding
>this tool, we determined that some inefficiencies dictated a design change.
>This design change proliferated itself through the entire system. The coding
>for this change took about a man-month, but the debug and reintegration
>phase took only two days. The system ran as before, must more efficient
>due to the design change. Had the code been written in C, this would not
>have happened. Many of the errors that were interjected by the engineers
>were due to spelling, wrong variable selection, or unhandled boundary
>conditions. These errors would not have come out during C compilation.

	Partially true.  Any person who does not use lint on all code in
a large (or even small) project deserves what they get.  Lint catches many
things, though not as many as Ada.  If the system has been designed using
good methodology, it should be fairly easy to ripple changes through
whether it's in Ada or C.  Also, many errors I have seen in Ada programs
are also subtle, and often due to the immensity of the language, and the
trouble figuring out how it should behave when using various constructs
together.  (See many of the past messages here for examples).

>They would have manifested themselves in various (or nefarious) bugs. These
>interjected errors were found (80% approx) during compilation of the code.
>An additional 15% were found on first startup of the system by constraint
>and unhandled exceptions. The remainder were found on integration.

	The thing that causes the most errors that I have seen are Ada
compilers that don't warn you when you access an unitialized variable, therefor
causing random failures (the worst kind!)  Even my micro-computer C compiler
warns me of these (without even running lint.)  In fact, I saw people try to
figure out whether integers (and variables in general) were initialized
for several hours (I HATE the LRM!)
	If the government is concerned with reliability of software, they'd
better get some compilers that can find this, or it's all been for naught.
(I know it's easy, is there something in the language spec that says not
to warn the user?!)

>My suggestion is that you learn software engineering, object oriented
>design, and the use of software tools. Then learn Ada. You will find
>that the C will come in handy when you have to try to understand what
>some engineer did so to do an Ada redesign.

	Ditto about learning good design.  C is useful in many other situations
where Ada is not, and vice versa.

	I believe that for each problem (and set of contraints, such as time/
resources/etc), there is a most appropriate language, from FORTRAN to Ada to
C to Cobol (Yuch!) to assembler to Prolog to Lisp (etc).  The worst code 
you'll see is when someone tries to fit a XXXX language slipper (solution)
on a YYYY language foot (problem).  It may very well be that for the major
class of problems the DOD has that Ada is an appropriate solution.  But
certainly not for all problems the DOD has, and absolutely not for all 
problems anywhere.

>Eric Beser
>EBESER@ADA20   - arpa
>{mimsy}!aplcen!cp1!sarin!eric - usenet

	Randell Jesup
	jesup@steinmetz.UUCP
	jesup@ge-crd.arpa

  parent reply	other threads:[~1987-08-26  9:25 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1987-08-17 21:36 "C" vrs ADA Glen Harman
1987-08-18 14:49 ` spf
1987-08-19 17:03   ` "C" AND Ada Eugene Miya N.
1987-08-20  1:52     ` Richard Harter
1987-08-20 17:29       ` "C" AND Ada (epigram) David Palmer
1987-08-21  9:09       ` "C" AND Ada Kent Paul Dolan
1987-08-19 20:45   ` "C" vrs ADA ark
1987-08-20 20:10     ` Stephen 2. Williams
1987-08-21  0:19     ` Jef Poskanzer
1987-08-21  9:15     ` Webber
1987-08-21  1:04   ` R.A. Agnew
1987-08-21 15:27     ` spf
1987-08-23  0:35     ` Henry Spencer
1987-08-23 18:07       ` wyatt
1987-08-25 17:55         ` John Unekis
1987-08-25 18:57       ` David C. Albrecht
1987-08-27 16:32         ` Henry Spencer
1987-08-28 16:31           ` Renu Raman, Sun Microsystems
1987-08-28 15:51         ` Peter da Silva
1987-08-30  1:05           ` Rahul Dhesi
1987-08-31 13:55             ` sns
1987-09-04 16:51             ` VAX/VMS C Jim Sullivan
1987-08-18 15:17 ` "C" vrs ADA G.Gleason
1987-08-18 18:09 ` John Unekis
1987-08-21 12:07   ` Mr. Patrick J. Kelly Jr. GS-13
1987-08-21 13:00   ` steve
1987-08-21 14:04   ` Stefan M. Vorkoetter
1987-08-22 23:31     ` COBOL vs "C" vs ADA neubauer
1987-08-24 23:11       ` Dave Levenson
1987-08-25 19:18         ` FORTRAN vs COBOL vs Pascal vs C " Stephen the Greatest
1987-08-23 13:13     ` COBOL vrs Ada (was: Re: "C" vrs ADA) Kent Paul Dolan
1987-08-21 14:17   ` "C" vrs ADA M.P.Lindner
1987-08-21 15:10   ` Dave Haynie
1987-08-21 16:07   ` crowl
1987-08-22  2:44     ` hitchens
1987-08-27 18:53       ` jym
1987-08-22 14:31     ` Roy Smith
1987-08-26 16:17     ` Kurt Hoyt
1987-08-23  0:33   ` Henry Spencer
1987-08-18 18:43 ` Dave Haynie
1987-08-22 21:09   ` Eric Beser sys admin
1987-08-25 16:35     ` David Palmer
1987-08-26 14:21       ` spf
1987-08-28  0:49       ` peter
1987-09-03 20:03         ` R.A. Agnew
1987-08-26  3:38     ` Doug Gwyn 
1987-08-26 19:32       ` Charles Simmons
1987-08-26  9:25     ` Randell Jesup [this message]
1987-08-26 15:40     ` M.P.Lindner
1987-08-27 17:44       ` Jeff Bartlett
1987-08-31 17:53         ` mpl
1987-09-01 22:03           ` Barry Margolin
1987-09-02  0:32       ` eric
1987-08-26 18:30     ` Dave Haynie
1987-08-29  6:25     ` Henry Spencer
1987-09-01 19:02 ` Jacob Gore
1987-09-02 14:09 ` stt
  -- strict thread matches above, loose matches on Subject: below --
1987-08-25 20:44 blackje%sungod.tcpip
     [not found] <822@s.cc.purdue.edu>
1987-08-28 12:33 ` kelly
replies disabled

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