comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: Ada ad in Embedded Systems Programming stinks
Date: 8 Sep 94 17:28:20
Date: 1994-09-08T17:28:20+00:00	[thread overview]
Message-ID: <EACHUS.94Sep8172820@spectre.mitre.org> (raw)
In-Reply-To: dag@control.lth.se's message of 08 Sep 1994 17:12:57 GMT

In article <DAG.94Sep8191257@bellman.control.lth.se> dag@control.lth.se (Dag Bruck) writes:

  > What areas, he asked curiously...  I would be greatly interested in a
  > discussion of things that C does better than Ada, in particular from
  > someone whose understanding of Ada is beyond doubt.

   The canonical example is device drivers.  But any code where the
bit representation is more important than the data's value or where
you spend a lot of time "punning" between two different views of the
same data fall in the same category.  For example, a compression
algorithm that uses variable length representations of repeated
strings.  You can write these in Ada--with liberal use of
Unchecked_Conversion--but it is more readable if you use bit
operations on integers, or union types, etc.

   Another (ancient) case was where I needed to find the first bit set
in a large Boolean array.  The trick was to convince the compiler to
use the special string processing operations, then do a conversion
from the first non-null character found to a bit offset.  (Anyone else
remember translate and test instructions?  In any case, the array was
very sparse, and this way the only use of memory bandwidth was to
fetch data.)  Could have written it in assembler, but this code was
portable.  It just wouldn't run anywhere near as fast on a different
hardware architecture.

--

					Robert I. Eachus

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



  reply	other threads:[~1994-09-08 17:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CvFI4J.D5M@world.std.com>
     [not found] ` <34ecqc$b5q@source.asset.com>
     [not found]   ` <34g5v3INN6q2@phage.cshl.org>
1994-09-06 13:46     ` Ada ad in Embedded Systems Programming stinks david.c.willett
     [not found]     ` <EACHUS.94Sep6094018@spectre.mitre.org>
1994-09-08  7:04       ` Dag Bruck
1994-09-08  9:52         ` Robert I. Eachus
1994-09-08 17:12           ` Dag Bruck
1994-09-08 17:28             ` Robert I. Eachus [this message]
1994-09-22  8:51         ` Brendan WALKER
1994-09-07 22:44   ` John Goodsen
1994-09-08  6:32     ` Keith Thompson @pulsar
     [not found] ` <1994Sep1.084046.21595@sei.cmu.edu>
     [not found]   ` <344u9q$di5@gnat.cs.nyu.edu>
     [not found]     ` <347idh$15ss@watnews1.watson.ibm.com>
     [not found]       ` <1994Sep4.092729.21408@lmpsbbs.comm.mot.com>
1994-09-07 22:46         ` John Goodsen
1994-09-08  6:47           ` Keith Thompson @pulsar
1994-09-08  8:52             ` David Emery
1994-09-11  3:41       ` Michael M. Bishop
1994-09-11 12:20         ` Robert Dewar
1994-09-11 13:29           ` Robert Dewar
1994-09-12 14:03             ` Norman H. Cohen
1994-09-11 21:48           ` Erik Naggum
1994-09-11 23:47             ` Robert Dewar
1994-09-12  6:28               ` Dag Bruck
1994-09-12 12:22                 ` David Weller
1994-09-12 20:03               ` Erik Naggum
1994-09-12 19:16             ` Maarten Landzaat
1994-09-13 10:10               ` Richard A. O'Keefe
1994-09-17 12:07                 ` Fred McCall
1994-09-12 20:49         ` Mitch Gart
1994-10-13 10:51 Bob Wells #402
replies disabled

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