comp.lang.ada
 help / color / mirror / Atom feed
From: Alan Brain <aebrain@dynamite.com.au>
Subject: Re: ada and robots
Date: 1997/06/11
Date: 1997-06-11T00:00:00+00:00	[thread overview]
Message-ID: <339F6D27.4A68@dynamite.com.au> (raw)
In-Reply-To: gwinn-1006971856380001@dh5055139.res.ray.com


Joe Gwinn wrote:

> There were some Ada compilers that did direct hardware OK, but the code
> wasn't portable between Ada compilers.  One could have made many of them
> work anyway, but why would you?  Portability was one of the major reasons
> for use of Ada.  It was simpler to use assembly for those few bits that
> touched I/O registers.

Er... the cards concerned were a KAV-30 (DEC compiler) card and a dual
Intel i860 Card (DDCI compiler).
The code was identical, with the exception of the representation
clauses. This was way less that 1 line per 100,000. I'd call that
portable. Especially since it was first run on a MicroVax before
porting.

The others, because of different application domains, only had maybe 40%
of the code in common.
For the SEC, much of the code was written on PCs before porting, using
either a Thomson/Alsys, Meridien or Irvine compiler (Yes, all 3 were
used at one stage, in 2 different continents and 5 different sites).
Target was a mixture of Winterstein/68040 and DecAda/KAV-40.
For the MFCC, much of the code was compiled using the Winterstein
compiler for the 680X0 series, after first being trialed on a Vax.

How much more portable do you want?
 
> I've seen bad code written in good languages too.  Even in Ada.  Bad
> programmers write bad programs.

True, but Irrelevant. A Good programmer, however, can often write a
better program in less time and using less costly tools when using one
language as compared to another.   

> Whenever one reimplements old code into a new language, any language, one
> generally discovers lots of bugs, often to the point that it isn't obvious
> how the old code could have worked at all.

Now there I completely agree! There's a lot to be said for "If it ain't
broke, don't fix it." When you have a good, solid, library, be it in C
or assembler or Cobol or whatever, it's a Black Box. To state the
obvious, all you care about is its external image (what parameters are
passed etc) and what its behaviour is.

Trouble is, much - if not most - COTS software does not perform 100% to
spec. If you're lucky, it just returns bum values. If not, it has memory
leaks, writes to memory way outside its scope etc. This is true for
software written "in-house" as well as purchased. If the library is in a
language with strong typing, with runtime checking possible, then it
greatly decreases the likelihood of errors. If your calling program also
has strong typing and run-time checking, it allows the programmer to
minimise the effects of such problems.
(Example: On the aforesaid project, the D-stepping of the i860 had a
nasty hardware design bug, where when paging, caching, pipelining and
interrupts were all enabled, if an integer load occurred where the
address loaded was within 16 words of the load instruction, and an
interrupt occurred, then the interrupt return register was corrupted.
Usually, but not always, zeroed. Because of the extreme error-recovery
techniques employed, such "branch to random locations in memory" were
liveable with. And more importantly, the behaviour of the system allowed
us to swiftly (well... 6 months....) zero in on the problem. 5 months
and 27 days it took us to eliminate the possibility of a compiler bug. 3
days for me personally to propose the hypothesis, and formulate the
experiment that made the effect reproducible at will, and about 10
minutes to re-work the DDCI compiler's interrupt-handling mechanism to
work around the problem. )

In many another language, such as C or Assembler, I don't see how we
could realistically have tracked down the problem. It would be just "one
of those unexplainable glitches" that are all to common.
  
Much of the argument re C vs Ada can be compared to the old seat-belt
argument. One faction says that a Good Driver without a seat belt is
safer than a bad driver with one. The other is attempting - and failing
- to get across the point that a Good Driver with a seat belt is safer
still, and often a seat belt can save a Bad Driver from being killed.
But enough, I'm straying into generalities, when I only wanted to give a
fairly conclusive counter-example.

-- 
aebrain@dynamite.com.au     <> <>    How doth the little Crocodile
| Alan & Carmel Brain|      xxxxx       Improve his shining tail?
| Canberra Australia |  xxxxxHxHxxxxxx _MMMMMMMMM_MMMMMMMMM
100026.2014 compuserve o OO*O^^^^O*OO o oo     oo oo     oo  
                    By pulling MAERKLIN Wagons, in 1/220 Scale
See http://www.z-world.com/graphics/z/master/8856.gif for picture






  parent reply	other threads:[~1997-06-11  0:00 UTC|newest]

Thread overview: 132+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-05  0:00 ada and robots Marin David Condic, 561.796.8997, M/S 731-93
1997-06-09  0:00 ` Jerry Petrey
1997-06-10  0:00   ` Alan Brain
1997-06-10  0:00     ` Joe Gwinn
1997-06-11  0:00       ` Robert Dewar
1997-06-11  0:00         ` Samuel Mize
1997-06-13  0:00           ` Erik Magnuson
1997-06-17  0:00         ` Joe Gwinn
1997-06-18  0:00           ` Jon S Anthony
1997-06-19  0:00             ` Jonathan Guthrie
1997-06-20  0:00           ` Robert Dewar
1997-06-11  0:00       ` Alan Brain [this message]
1997-06-11  0:00         ` Joe Gwinn
1997-06-11  0:00         ` Spam Hater
  -- strict thread matches above, loose matches on Subject: below --
1997-07-02  0:00 Ada " Huy Vo
1997-07-04  0:00 ` Richard A. O'Keefe
1997-07-01  0:00 Huy Vo
1997-07-02  0:00 ` Wes Groleau
1997-06-30  0:00 Huy Vo
1997-07-01  0:00 ` Alan Brain
1997-07-11  0:00   ` Will Rose
1997-07-02  0:00 ` Mattias Sj�sv�rd
     [not found] <867541382.23405@dejanews.com>
1997-06-29  0:00 ` John Howard
1997-06-26  0:00 Huy Vo
1997-06-27  0:00 ` nma123
1997-06-27  0:00 ` Wes Groleau
1997-06-27  0:00 ` Jon S Anthony
1997-06-27  0:00 ` Alan Brain
1997-06-27  0:00   ` Wes Groleau
1997-06-27  0:00   ` Stephen Leake
1997-06-27  0:00 ` Richard A. O'Keefe
1997-06-24  0:00 Huy Vo
1997-06-25  0:00 ` Wes Groleau
1997-06-25  0:00 ` Dale Stanbrough
1997-06-25  0:00 ` Alan Brain
1997-06-25  0:00 ` Jon S Anthony
1997-06-26  0:00 ` Ken Garlington
1997-07-01  0:00   ` Tom Moran
1997-06-20  0:00 Huy Vo
1997-06-23  0:00 ` Jon S Anthony
1997-06-19  0:00 ada " Jon S Anthony
1997-06-19  0:00 ` Brian Rogoff
1997-06-20  0:00   ` Jon S Anthony
1997-06-22  0:00   ` John G. Volan
1997-06-25  0:00     ` Richard A. O'Keefe
1997-06-23  0:00   ` Robert Dewar
1997-06-24  0:00     ` Brian Rogoff
1997-06-16  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-06-16  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-06-17  0:00 ` Joe Gwinn
1997-06-18  0:00   ` Jon S Anthony
1997-06-18  0:00     ` Brian Rogoff
1997-06-20  0:00   ` Robert Dewar
1997-06-23  0:00     ` Richard Kenner
1997-06-23  0:00       ` Robert Dewar
1997-06-23  0:00     ` Geert Bosch
1997-07-02  0:00       ` Robert Dewar
1997-06-25  0:00   ` Will Rose
1997-06-25  0:00   ` Jonathan Guthrie
1997-06-21  0:00 ` Nick Roberts
1997-06-12  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-06-09  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-06-05  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-05-28  0:00 John Bohn
1997-05-29  0:00 ` Stephen Leake
1997-05-29  0:00 ` Michael F Brenner
1997-05-30  0:00 ` John Cook
1997-05-30  0:00   ` Tom Moran
1997-06-01  0:00     ` Dale Stanbrough
1997-06-02  0:00       ` John G. Volan
     [not found]         ` <5mv984$7kn@news.emi.com>
1997-06-03  0:00           ` Martin A. Stembel
1997-06-03  0:00           ` Joe Gwinn
1997-06-04  0:00             ` Pat Rogers
1997-06-05  0:00               ` Joe Gwinn
1997-06-14  0:00                 ` Robert Dewar
1997-06-16  0:00                 ` Ken Garlington
1997-06-16  0:00                   ` Robert Dewar
1997-06-17  0:00                   ` Joe Gwinn
1997-06-28  0:00                     ` Mike Stark
1997-07-03  0:00                       ` Joe Gwinn
1997-06-04  0:00             ` John G. Volan
1997-06-05  0:00               ` Joe Gwinn
1997-06-14  0:00                 ` Robert Dewar
1997-06-17  0:00                   ` Joe Gwinn
1997-07-03  0:00                     ` Shmuel (Seymour J.) Metz
     [not found]               ` <9706052229.AA29554@jaguar.nmc.ed.ray.com>
1997-06-06  0:00                 ` John G. Volan
1997-06-07  0:00                   ` RC
1997-06-09  0:00                   ` Joe Gwinn
1997-06-05  0:00             ` Jon S Anthony
1997-06-05  0:00               ` Joe Gwinn
1997-06-14  0:00                 ` Robert Dewar
1997-06-10  0:00             ` Robert Dewar
1997-06-10  0:00               ` Joe Gwinn
1997-06-11  0:00                 ` Robert Dewar
1997-06-12  0:00                   ` George Haddad
1997-06-16  0:00                   ` Matthew S. Whiting
1997-06-17  0:00                     ` Robert A Duff
1997-06-18  0:00                       ` Ken Garlington
1997-07-17  0:00                         ` Shmuel (Seymour J.) Metz
1997-06-20  0:00                       ` Adam Beneschan
1997-06-20  0:00                       ` Robert Dewar
1997-06-17  0:00                     ` Robert Dewar
1997-06-17  0:00                     ` Samuel Mize
1997-06-18  0:00                       ` Steve O'Neill
1997-06-19  0:00                         ` Anonymous
1997-06-19  0:00                       ` Kenneth W. Sodemann
1997-06-20  0:00                       ` Stephen Leake
1997-06-20  0:00                         ` Robert Dewar
1997-06-17  0:00                     ` Jon S Anthony
1997-06-17  0:00                       ` Matthew S. Whiting
1997-06-18  0:00                         ` Jon S Anthony
1997-06-22  0:00                           ` John G. Volan
1997-06-18  0:00                         ` Samuel Mize
1997-06-18  0:00                           ` Matthew S. Whiting
1997-06-18  0:00                         ` Robert A Duff
1997-06-17  0:00                     ` Stephen Leake
1997-06-17  0:00                       ` Robert A Duff
1997-06-20  0:00                       ` jim granville
1997-06-21  0:00                         ` Robert Dewar
1997-06-29  0:00                         ` Matthew Heaney
1997-07-03  0:00                           ` Shmuel (Seymour J.) Metz
1997-07-13  0:00                             ` Robert Dewar
1997-06-04  0:00         ` RC
1997-06-04  0:00           ` John G. Volan
1997-06-04  0:00           ` Larry Kilgallen
1997-06-05  0:00           ` Jon S Anthony
1997-06-02  0:00     ` Nick Roberts
1997-06-04  0:00       ` Jan Galkowski
1997-06-05  0:00         ` Albert K. Lee
1997-06-06  0:00           ` dana
1997-06-07  0:00             ` John G. Volan
1997-06-10  0:00               ` dana
replies disabled

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