From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dab7d920e4340f12 X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,dab7d920e4340f12 X-Google-Attributes: gid1014db,public From: Ken Garlington Subject: Re: C is 'better' than Ada because... Date: 1996/07/19 Message-ID: <31EF7E48.5ABE@lmtas.lmco.com>#1/1 X-Deja-AN: 168923478 references: <31e02c32.342948604@netline-fddi.jpl.nasa.gov> <4rr961$hdk@btmpjg.god.bel.alcatel.be> <31e180c5.430136383@netline-fddi.jpl.nasa.gov> <4s4adc$l4a@ecuador.it.earthlink.net> <31EA0B65.3EF8@wgs.estec.esa.nl> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Tactical Aircraft Systems mime-version: 1.0 newsgroups: comp.lang.ada,comp.lang.c x-mailer: Mozilla 2.02 (Macintosh; I; 68K) Date: 1996-07-19T00:00:00+00:00 List-Id: Sandy McPherson wrote: > > It depends upon which type of large system you wish to implement. Ever > tried to write an operating system, or a configurable toolkit, which needs > to use callbacks, in Ada? Yes - in fact, there are multiple RTOSs on my project written in Ada. > A Motif based GUI? I have personally written nultiple Ada tools on DEC that use Motif. Callbacks work just fine, and they are quite straightforward to implement. Ada 95, with an explicit access-to-subprogram feature, probably makes this equally simple on all platforms. > Whether this is a problem of Ada > as a language is disputable Absolutely. > If on the other hand you have a bare chip and need to write a complex > embedded system, (and you have a GOOD Ada compiler), then Ada is probably a > better starting point, because there are so many fetures built into the > language which you have to do manually when coding good C. Since I haven't written much C for embedded systems, I couldn't say. > The main advantage that C has over Ada is that the compilers are generally > very reliable (because of their small size) Possibly - I have seen reliable Ada compilers and not-so-reliable ones. > and produce efficient machine code. Why is this an advantage of C over Ada? Ada certainly produces efficient machine code, given a good compiler. In fact, there are examples of Ada outperforming C with regard to efficiency. > Tasking looks like a good idea, > but the implementations can be weak; in fact most spacecraft control > systems I have seen implement their own tasking mechanisms, especially > where they have to respond to hardware interrupts. This has been my experience as well. However, protected records may be a better mechanism for some of those cases where tasking wasn't appropriate. -- LMTAS - "Our Brand Means Quality"