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


In article <339F6D27.4A68@dynamite.com.au>, aebrain@dynamite.com.au wrote:

> 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 don't doubt your experience, but mine, using different hosts, targets,
and compilers, is different.  In fact, when porting a message-based
middleware system, we had more trouble with Ada compiler differences than
operating system differences.


> > 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.   

A truism, but not irrelevant.  There are lots more bad programmers than
good ones.  As far as choice of language goes, what matters is the degree
of match between the problem and the language, and also the quality of the
entire code developments system.


> > 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.

The more miles it has on it, the better.


> 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. 

Isn't this true in general, true of *all* software?  And, if so, language
has nothing to do with it.


> ... 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.

This is a claimed advantage of both Ada and C++.  I have heard lots of
contrary complaints against both languages saying that the protection is
too dearly bought.  It certainly has been the case when attempting to
implement middleware and comms infrastructure, where strong typing is more
hinderance than help.


> (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.

Oh, come now.  These kinds of bugs are caught (albeit at great expense)
and fixed all the time, and have been since the first program was written,
in every language imaginable.  I have lots of not fond memories of solving
exactly these sorts of bugs in assembly coded systems.  It's no easier
now, and runtime checks aren't that much help, because random hardware
bugs do not follow the logic of the program, regardless of language.  See
last point.


> 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.

Well, this entire thread reminds me of nothing so much as the discussions
of twenty years ago that my cohorts and I had when we were transitioning
from assembly code to fortran.  Strange to say, it was actually a good
deal easier to debug assembly code than fortran, because, with assembly,
nothing was hidden.  However, fortran was something like four times as
productive as assembly, even though debugging was somewhat harder, so
transition to fortran was an economic necessity.  Still, there was a hard
core of bugs that, even though the code was written in fortran, could only
be solved at the assembly level, because there is a level of logic not
visible to the fortran programmer.  

Likewise, Ada.  Never forget that Ada is a great deal more complex than
fortran, so even more is hidden, even more is assumed.  A few years ago, I
got some of my people out of a jam by debugging their Ada code (of which I
knew almost nothing) at the underlying assembly level.  They could not
figure the problem out after weeks of trying; the information was simply
unavailable at the Ada level.  It took only me a few hours, because I
could see things as they truely were, unconfused by the surface Ada
structure of their program.  The problem turned out to be a classic
Ada-to-OS interface bug: Ada sizes are generally bits, while the OS
expected bytes, so eight times as much data as expected came back from the
OS, causing physically nearby but logically unrelated data structures to
be stomped.  The errors coming from Ada were exactly zero help, but were
numerous and confusing.  

I have accumulated similar fortran, C, and pascal stories over the years.

I guess a fundamental lament is that [most] programmers today don't know
assembly, are even frightened of it, so when something like this happens,
they're helpless.  I saw this problem in the days of fortran, and I still
see it today.

Joe Gwinn




  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
1997-06-11  0:00         ` Spam Hater
1997-06-11  0:00         ` Joe Gwinn [this message]
  -- 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 ` Wes Groleau
1997-06-27  0:00 ` nma123
1997-06-27  0:00 ` Richard A. O'Keefe
1997-06-27  0:00 ` Alan Brain
1997-06-27  0:00   ` Stephen Leake
1997-06-27  0:00   ` Wes Groleau
1997-06-27  0:00 ` Jon S Anthony
1997-06-24  0:00 Huy Vo
1997-06-25  0:00 ` Jon S Anthony
1997-06-25  0:00 ` Alan Brain
1997-06-25  0:00 ` Dale Stanbrough
1997-06-25  0:00 ` Wes Groleau
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   ` Jonathan Guthrie
1997-06-25  0:00   ` Will Rose
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             ` 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-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-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                     ` Jon S Anthony
1997-06-17  0:00                       ` Matthew S. Whiting
1997-06-18  0:00                         ` Robert A Duff
1997-06-18  0:00                         ` Samuel Mize
1997-06-18  0:00                           ` Matthew S. Whiting
1997-06-18  0:00                         ` Jon S Anthony
1997-06-22  0:00                           ` John G. Volan
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                     ` 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-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-04  0:00         ` RC
1997-06-04  0:00           ` Larry Kilgallen
1997-06-04  0:00           ` John G. Volan
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