comp.lang.ada
 help / color / mirror / Atom feed
From: Gordon Sande <g.sande@worldnet.att.net>
Subject: Re: Ada vs Fortran for scientific applications
Date: Thu, 25 May 2006 12:45:41 GMT
Date: 2006-05-25T12:45:41+00:00	[thread overview]
Message-ID: <2006052509454116807-gsande@worldnetattnet> (raw)
In-Reply-To: pan.2006.05.25.12.11.52.919554@linuxchip.demon.co.uk.uk.uk

On 2006-05-25 09:09:59 -0300, "Dr. Adrian Wrigley" 
<amtw@linuxchip.demon.co.uk.uk.uk> said:

> On Wed, 24 May 2006 23:04:03 -0700, Richard Maine wrote:
> 
>> Nasser Abbasi <nma@12000.org> wrote:
>> 
>>> I just did this simple test, declare an array and go overbound and see if we
>>> get a run-time error:
>> ...
>>> $ g95 f.f90
>> ...
>>> $   <------------------- NO runtime ERROR
>> 
>> This part of the thread has started drifting away from relevance to much
>> of anything, but that particular sample is just drifting yet further. It
>> illustrates neither much about subscript bounds rules being part of the
>> language nor about bounds checking being part of the language, which
>> were the two topics mentioned earlier in the subthread.
>> 
>> Instead, the example illustrates only that g95 does not have the bounds
>> check option enabled by default, which is yet a third question (and one
>> mentioned in more generality earlier).
>> 
>> As with most compilers, g95 does have a bounds check option; it just
>> isn't enabled by default. Compiling your same example, but asking for
>> bounds checking, gets it. In particular, compiling and running your
>> example code on my Mac here with
>> 
>> g95 -fbounds-check clf.f90
>> ./a.out
>> 
>> Gives me:
>> 
>> At line 4 of file clf.f90
>> Traceback: not available, compile with -ftrace=frame or -ftrace=full
>> Fortran runtime error: Array element out of bounds: 11 in (1:10), dim=1
>> 
>> which is, in fact, more detailed than the message you showed from gnat.
>> (Turning on the trace options gets rid of the message about not having
>> one, but it is trivial and adds nothing else useful for this example.)
> 
> Bounds checking code is not needed if it can be proved never
> to fail.  Sometimes the compiler can do that.  Sometimes the
> programmer can do that, even if the compiler can't.
> This is why the *source code* should be able to disable and re-enable
> checks with fine granularity.  Programmers can comment the code
> as to why checks are unnecessary and disable them.  This fine-grain
> control over checking needs to be standardized across compilers,
> otherwise source files become non-portable.
> (note: IIRC, the Ariane 5 launch failure was linked to disabling a
> range check after careful analysis... of Ariane 4 trajectory)
> 
> A couple of questions about Fortran:
> Are bounds check failures trappable in a standard way so the
>    program can continue?
> Can it be controlled on a finer grain than per compilation?

I am a big fan of subscript checking and undefined variable checking.
I have found that all of the errors that these aids have found have been
in parts of my programs that I believed to be free of such errors
because I had looked hard at them some time before. Either I had
not done a good job of looking or the assumptions underlying the look
had changed.

That seems to be the nature of the beast.

I can avoid (usually!) the trival bugs. I like getting help once the
bug is not trivial. (Maybe that is a definition of trivial.)

Fine grained control would have been of no use, and in fact harmful,
if I had tried to use it. My take is it makes a great checklist feature
that may help get past "desired feature checklists" but is otherwise
not of any real benefit. The check is great but fine grained control
is not.

> Do user defined numerical types have restricted bounds too?

That is a Pascal-like feature that I miss in Fortran. So I do my own
checking. Because of my problem domain I have to be proactive in checking
parameter values on entry to new procedures even if the invocation is
from one that has already checked. The buzz word is programming by contract
if I have read the programming fashion of the day rags.

How many Ada systems can match the undefined variable checking of the
old WatFor or the current Salford CheckMate or the Lahey/Fujitsu
global checking? It seems to be a thing associated with places that
run student cafteria computing on mainframes. Not much used anymore.
There was a similar student checkout PL/I from Cornell if I recall
correctly.

> The adverse consequences of exceeding bounds can be seen to
> outweigh the (usually) modest costs in code size and performance that
> even mature code should ship with checks enabled, IMO.
> Compilers generally should be shipped with the 'failsafe'
> options on by default.





  parent reply	other threads:[~2006-05-25 12:45 UTC|newest]

Thread overview: 314+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-22  4:54 Ada vs Fortran for scientific applications Nasser Abbasi
2006-05-22  6:45 ` Brooks Moses
2006-05-22  7:41   ` Jan Vorbrüggen
2006-05-22 18:49     ` Brooks Moses
2006-05-23  5:51       ` Tim Prince
2006-05-23  8:56       ` Jan Vorbrüggen
2006-05-23 13:28         ` Greg Lindahl
2006-05-24  8:10           ` Jan Vorbrüggen
2006-05-24 15:19             ` Richard E Maine
2006-05-29 12:55               ` Jan Vorbrüggen
2006-05-24 15:24             ` Dick Hendrickson
2006-05-24 19:03               ` glen herrmannsfeldt
2006-05-29 12:56                 ` Jan Vorbrüggen
2006-05-29 20:07                   ` glen herrmannsfeldt
2006-05-30  4:55                   ` robert.corbett
2006-05-30  7:05                     ` Jan Vorbrüggen
2006-05-22 11:48   ` Michael Metcalf
2006-05-22 12:01     ` Dr. Adrian Wrigley
2006-05-23  8:34   ` Jon Harrop
2006-05-22  7:34 ` Dmitry A. Kazakov
2006-05-23  8:32   ` Jon Harrop
2006-05-22  7:36 ` Greg Lindahl
2006-05-22 21:25   ` Ken Plotkin
2006-05-22 21:40     ` blmblm
2006-05-23  2:12       ` Ken Plotkin
2006-05-23 15:32     ` Pascal Obry
2006-05-23 17:33       ` Marc A. Criley
2006-05-22 10:34 ` Tim Prince
2006-05-22 12:52 ` George N. White III
2006-05-22 13:02 ` Jean-Pierre Rosen
2006-05-22 15:23   ` Dan Nagle
2006-05-22 16:20     ` Nasser Abbasi
2006-05-22 16:38       ` Jan Vorbrüggen
2006-05-22 16:41       ` Gordon Sande
2006-05-22 16:48       ` Dan Nagle
2006-05-23  2:12         ` news.hinet.net
2006-05-22 17:22       ` Paul Van Delst
2006-05-23  7:04         ` Gareth Owen
2006-05-23  7:02           ` Martin Krischik
2006-05-23 14:23           ` Rich Townsend
2006-05-23 17:24             ` Brooks Moses
2006-05-23 18:40               ` Rich Townsend
2006-05-23 21:17                 ` Martin Dowie
2006-05-24  2:21                   ` Nasser Abbasi
2006-05-26 15:18                     ` Martin Dowie
2006-05-25 19:43                 ` Janne Blomqvist
2006-05-24  5:26       ` robin
2006-05-24  6:06         ` GF Thomas
2006-05-22 16:38     ` Richard E Maine
2006-05-23  8:25     ` Jean-Pierre Rosen
2006-05-23 11:40       ` Dan Nagle
2006-05-23 13:14         ` Dr. Adrian Wrigley
2006-05-23 17:07           ` Dan Nagle
2006-05-23 22:20             ` Dr. Adrian Wrigley
2006-05-23 22:49               ` Dan Nagle
2006-05-23 23:21                 ` Dr. Adrian Wrigley
2006-05-24  0:49                   ` Dan Nagle
2006-05-24  5:07                     ` GF Thomas
2006-05-24 12:56               ` J.F. Cornwall
2006-05-24 13:39                 ` Dr. Adrian Wrigley
2006-05-24 16:49                   ` J.F. Cornwall
2006-05-24 18:08                     ` Dr. Adrian Wrigley
2006-05-24  5:26         ` robin
2006-05-27  5:18         ` Aldebaran
2006-05-23 17:09       ` Dick Hendrickson
2006-05-23 17:53         ` Georg Bauhaus
2006-05-23 18:21         ` Dmitry A. Kazakov
2006-05-23 18:34           ` Brooks Moses
2006-05-24  7:15             ` Dmitry A. Kazakov
2006-05-23 20:33           ` Dick Hendrickson
2006-05-24  7:52         ` Jean-Pierre Rosen
2006-05-24 14:50         ` robin
2006-05-24 15:19           ` Dick Hendrickson
2006-05-24 15:43             ` Dr. Adrian Wrigley
2006-05-24 17:12               ` Dick Hendrickson
2006-05-24 17:32                 ` Richard E Maine
2006-05-24 17:54                 ` Dr. Adrian Wrigley
2006-05-24 18:10                   ` Richard E Maine
2006-05-24 18:39                     ` Nasser Abbasi
2006-05-24 19:36                       ` Gautier
2006-05-24 19:37                       ` Gautier
2006-05-24 19:56                         ` Richard E Maine
2006-05-30 19:39                           ` Craig Powers
2006-05-26  2:58                         ` robin
2006-05-24 18:34                   ` Gordon Sande
2006-05-24 18:40                     ` Ed Falis
2006-05-25 22:31                       ` Brooks Moses
2006-05-24 18:43                     ` Ed Falis
2006-05-24 18:59                       ` J.F. Cornwall
2006-05-24 19:10                       ` Gordon Sande
2006-05-25  3:40                       ` robin
2006-05-25 15:19                         ` Martin Krischik
2006-05-27 14:29                           ` robin
2006-05-27 13:22                             ` Georg Bauhaus
2006-05-29 11:46                             ` Jan Vorbrüggen
2006-05-29 17:37                             ` Martin Krischik
2006-05-24 21:04                   ` Dick Hendrickson
2006-05-31  4:26                     ` robert.corbett
2006-05-25  3:40                   ` robin
2006-05-24 16:03             ` Richard E Maine
2006-05-24 19:08               ` glen herrmannsfeldt
2006-05-25  3:40             ` robin
2006-05-25  5:04               ` Nasser Abbasi
2006-05-25  6:04                 ` Richard Maine
2006-05-25 10:42                   ` Shmuel (Seymour J.) Metz
2006-05-25 15:09                     ` Richard E Maine
2006-05-25 19:39                       ` Shmuel (Seymour J.) Metz
2006-05-25 12:09                   ` Dr. Adrian Wrigley
2006-05-25 12:42                     ` Dan Nagle
2006-05-25 12:45                     ` Gordon Sande [this message]
2006-05-25 16:23                       ` Checking for Undefined [was Re: Ada vs Fortran for scientific applications] Bob Lidral
2006-05-25 17:48                         ` Nasser Abbasi
2006-05-25 17:57                         ` Gordon Sande
2006-05-25 20:20                           ` Bob Lidral
2006-05-27 14:29                             ` Checking for Undefined robin
2006-05-25 20:35                           ` Checking for Undefined [was Re: Ada vs Fortran for scientific applications] glen herrmannsfeldt
2006-05-25 22:02                           ` Checking for Undefined Simon Wright
2006-05-27 14:29                           ` robin
2006-05-27 15:10                             ` Gordon Sande
2006-05-26  2:58                       ` Ada vs Fortran for scientific applications robin
2006-07-09 20:52                       ` adaworks
2006-07-09 21:33                         ` Brooks Moses
2006-07-10  3:08                           ` jimmaureenrogers
2006-07-10 11:23                           ` Björn Persson
2006-07-10 17:08                             ` Brooks Moses
2006-07-09 21:36                         ` James Giles
2006-07-09 22:29                           ` Martin Dowie
2006-07-09 23:07                             ` James Giles
2006-07-09 23:44                               ` glen herrmannsfeldt
2006-07-11  1:29                               ` robin
2006-07-09 23:19                           ` glen herrmannsfeldt
2006-07-11  1:29                             ` robin
2006-07-11  5:56                               ` glen herrmannsfeldt
2006-07-12  0:37                                 ` robin
2006-07-12  1:15                                   ` glen herrmannsfeldt
2006-07-14  2:47                                     ` Randy Brukardt
2006-07-14  2:56                                       ` glen herrmannsfeldt
2006-07-18  1:48                                     ` robin
2006-07-18 18:35                                       ` glen herrmannsfeldt
2006-07-19 14:35                                         ` BINARY INTEGER robin
2006-07-10  7:38                           ` Ada vs Fortran for scientific applications Dmitry A. Kazakov
2006-07-10 16:41                             ` adaworks
2006-07-10 18:12                               ` John W. Kennedy
2006-07-11  1:29                                 ` robin
2006-07-11  2:49                                   ` John W. Kennedy
2006-07-12  0:37                                     ` robin
2006-07-11  1:29                             ` robin
2006-07-11  6:46                               ` adaworks
2006-07-11  7:30                                 ` James Giles
2006-07-11 20:46                                   ` Simon Wright
2006-07-11 11:44                                 ` Jeffrey Creem
2006-07-11 14:51                                   ` adaworks
2006-07-12  1:29                                     ` Jeffrey Creem
2006-07-11 13:53                                 ` Tom Linden
2006-07-11 15:02                                   ` adaworks
2006-07-11 15:35                                     ` Tom Linden
2006-07-11 16:54                                       ` Alex R. Mosteo
2006-07-11 17:43                                       ` adaworks
2006-07-11 18:15                                         ` Ed Falis
2006-07-11 14:46                                 ` John W. Kennedy
2006-07-11 14:45                                   ` Tom Linden
2006-07-11 17:06                                     ` John W. Kennedy
2006-07-11 15:16                                   ` glen herrmannsfeldt
2006-07-11 15:55                                     ` Richard E Maine
2006-07-11 16:21                                       ` Ed Falis
2006-07-11 16:28                                         ` Richard E Maine
2006-07-12  3:33                                       ` James Dennett
2006-07-11 17:08                                   ` Jean-Pierre Rosen
2006-07-11 22:44                                     ` glen herrmannsfeldt
2006-07-12  9:50                                       ` Jean-Pierre Rosen
2006-07-14  7:00                                         ` glen herrmannsfeldt
2006-07-12  3:35                                     ` James Dennett
2006-07-12  0:37                                   ` robin
2006-07-10  9:57                           ` Georg Bauhaus
2006-07-11 15:14                         ` robin
2006-07-11 17:21                           ` adaworks
2006-07-11 19:50                             ` John W. Kennedy
2006-11-20  9:39                         ` robin
2006-11-21  9:02                           ` Finalization Philippe Tarroux
2006-11-21  9:22                             ` Finalization Dmitry A. Kazakov
2006-11-21 10:32                               ` Finalization Philippe Tarroux
2006-11-21 11:09                                 ` Finalization Dmitry A. Kazakov
2006-11-21 17:29                                   ` Finalization Adam Beneschan
2006-11-21 18:39                                     ` Finalization Dmitry A. Kazakov
2006-11-21 17:22                                 ` Finalization Adam Beneschan
2006-11-21 11:26                             ` Finalization Georg Bauhaus
2006-05-25 16:25                     ` Bounds Check Overhead [was: Re: Ada vs Fortran for scientific applications] Bob Lidral
2006-05-25 22:08                       ` Bounds Check Overhead Simon Wright
2006-05-25 22:27                         ` Brooks Moses
2006-05-25 22:43                           ` Richard E Maine
2006-05-26 10:16                           ` Ludovic Brenta
2006-05-26 10:59                             ` Dan Nagle
2006-05-26 14:44                               ` Dick Hendrickson
2006-05-26 14:52                                 ` Rich Townsend
2006-05-26 16:44                                   ` Ludovic Brenta
2006-05-26 17:49                                     ` Gordon Sande
2006-05-27  9:06                                       ` Dmitry A. Kazakov
2006-05-27 14:44                                         ` Richard Maine
2006-05-29 12:02                                         ` Jan Vorbrüggen
2006-05-26 20:31                                     ` glen herrmannsfeldt
2006-05-27 14:29                                     ` robin
2006-05-26 14:59                                 ` gary.l.scott
2006-05-26 15:10                                   ` Dick Hendrickson
2006-05-26 18:41                                     ` gary.l.scott
2006-05-26 18:56                                       ` Dan Nagle
2006-05-26 19:16                                         ` Richard Maine
2006-05-27 14:29                               ` robin
2006-05-26 16:18                             ` Richard Maine
2006-05-26 17:30                               ` Nasser Abbasi
2006-05-26 18:24                                 ` Richard Maine
2006-05-26 19:23                                   ` Paul Van Delst
2006-05-26 19:25                                   ` Nasser Abbasi
2006-05-26 19:46                                     ` Richard Maine
2006-05-30 19:13                                       ` Robert A Duff
2006-06-04 23:48                                         ` Richard Maine
2006-05-26 18:26                                 ` Rich Townsend
2006-05-26 19:58                                   ` Simon Wright
2006-05-26 20:06                                     ` Rich Townsend
2006-05-26 20:16                                       ` Richard Edgar
2006-05-26 20:28                                       ` Richard Maine
2006-05-30 19:20                                         ` Robert A Duff
2006-06-05 13:50                                           ` Richard Edgar
2006-05-26 20:27                               ` glen herrmannsfeldt
2006-05-26 20:41                                 ` Richard Maine
2006-05-27 14:29                         ` robin
2006-05-27 14:56                           ` Ludovic Brenta
2006-05-27 15:53                             ` jimmaureenrogers
2006-05-27 15:59                             ` Dmitry A. Kazakov
2006-05-27 17:52                               ` Tom LINDEN
2006-05-28  6:28                                 ` Dave Weatherall
2006-05-26  2:58                     ` Ada vs Fortran for scientific applications robin
2006-05-29 12:21                     ` Jan Vorbrüggen
2006-05-29 13:47                       ` Dr. Adrian Wrigley
2006-05-29 14:17                         ` Jan Vorbrüggen
2006-05-29 14:52                           ` Dmitry A. Kazakov
2006-05-29 15:08                             ` Jan Vorbrüggen
2006-05-29 17:03                               ` Dmitry A. Kazakov
2006-05-30  7:11                                 ` Jan Vorbrüggen
2006-05-30  8:29                                   ` Dmitry A. Kazakov
2006-05-31 14:58                                     ` robin
2006-05-31 14:58                                 ` robin
2006-05-31 15:42                                   ` Dmitry A. Kazakov
2006-05-31 15:54                                     ` Gordon Sande
2006-05-31 14:58                             ` robin
2006-05-31 18:07                               ` Marc A. Criley
2006-05-29 15:47                           ` Dr. Adrian Wrigley
     [not found]                   ` <pan.2006.05.25.12.11.52.919554@linuxchip.demon.co.uk.u <2006052514574816807-gsande@worldnetattnet>
2006-05-25 18:30                     ` Checking for Undefined [was Re: Ada vs Fortran for scientific applications] Thomas Koenig
2006-05-25 18:34                       ` Gordon Sande
2006-05-26  2:58                   ` Ada vs Fortran for scientific applications robin
     [not found]                   ` <pan.2006.05.25.12.11.52.919554@linuxchip.demon.co.uk.u <m2r72h69vz.fsf@grendel.local>
2006-05-26  7:54                     ` Checking for Undefined Dirk Craeynest
2006-05-26 15:04                       ` Dick Hendrickson
2006-05-27 14:29                         ` robin
2006-05-27 15:08                           ` Gordon Sande
2006-05-28  0:56                             ` robin
2006-05-28  1:04                               ` glen herrmannsfeldt
2006-05-28 13:46                               ` Gordon Sande
     [not found]                   ` <pan.2006.05.25.12.11.52.919554@linuxchip.demon.co.uk.u <e574mu$rrj$1@scrotar.nss.udel.edu>
2006-05-26 18:53                     ` Bounds Check Overhead Thomas Koenig
2006-05-26 19:07                       ` Richard Maine
     [not found]                   ` <pan.2006.05.25.12.11.52.919554@linuxchip <20060712.7A4E6E0.D028@mojaveg.lsan.sisna.com>
     [not found]                     ` <20060712.7A4E6E0.D028@mojaveg.lsan.sisna.com>
2006-07-14  6:08                       ` Ada vs Fortran for scientific applications Bob Lidral
2006-07-14  6:17                         ` Richard Maine
2006-07-17 12:44                           ` ONES COMPLEMENT (was: Ada vs Fortran for scientific applications) robin
     [not found]                   ` <20060712.7A4E6E0.D028@mojaveg.lsan.sisna <20060714.7A4E988.A30D@mojaveg.lsan.sisna.com>
     [not found]                     ` <20060714.7A4E988.A30D@mojaveg.lsan.sisna.com>
2006-07-16  9:07                       ` Ada vs Fortran for scientific applications glen herrmannsfeldt
2006-07-18  1:48                         ` ONES COMPLEMENT (was: Ada vs Fortran for scientific applications) robin
2006-07-18 18:41                           ` ONES COMPLEMENT glen herrmannsfeldt
2006-07-19 13:41                             ` robin
2006-07-22  0:09                             ` Richard Steiner
     [not found]                   ` <20060712.7A4E6E0.D028@mojaveg.lsan.sisna <20060717.7A4ADD0.10B1A@mojaveg.lsan.sisna.com>
2006-07-18 13:05                     ` ONES COMPLEMENT (was: Ada vs Fortran for scientific applications) Shmuel (Seymour J.) Metz
2006-07-19 11:18                       ` ONES COMPLEMENT Peter Flass
2006-07-19 17:14                         ` glen herrmannsfeldt
2006-07-19 23:43                           ` robin
2006-07-19 13:41                       ` robin
2006-07-19 17:11                       ` ONES COMPLEMENT (was: Ada vs Fortran for scientific applications) Everett M. Greene
2006-07-19 19:40                         ` Shmuel (Seymour J.) Metz
2006-07-20 16:46                           ` Everett M. Greene
2006-07-20 21:47                             ` Shmuel (Seymour J.) Metz
2006-07-21 17:23                               ` ONES COMPLEMENT glen herrmannsfeldt
2006-07-21 18:04                                 ` John W. Kennedy
2006-07-23  0:26                                   ` robin
2006-07-23  0:26                                 ` robin
2006-07-21 20:05                               ` glen herrmannsfeldt
2006-07-21 21:00                                 ` Dick Hendrickson
2006-07-22  6:19                                   ` glen herrmannsfeldt
2006-07-22 15:12                               ` ONES COMPLEMENT (was: Ada vs Fortran for scientific applications) Everett M. Greene
2006-07-23  0:26                               ` ONES COMPLEMENT robin
     [not found]                     ` <20060717.7A4ADD0.10B1A@mojaveg.lsan.sisna.com>
2006-07-19  6:54                       ` glen herrmannsfeldt
2006-07-19 12:47                         ` Tom Linden
2006-07-19 14:35                         ` robin
2006-05-25 11:02               ` Ada vs Fortran for scientific applications Dan Nagle
2006-05-25 11:23                 ` Gareth Owen
2006-05-26  2:58                   ` robin
2006-05-26  7:13                     ` Gareth Owen
2006-05-26 14:53                     ` Dick Hendrickson
2006-05-26 20:18                       ` glen herrmannsfeldt
2006-05-26 21:50                         ` Björn Persson
2006-05-25 14:33                 ` glen herrmannsfeldt
2006-05-26  2:58                 ` robin
2006-05-26 20:03                 ` JA
2006-05-25 11:32             ` Martin Krischik
2006-05-24  6:46       ` Jan Vorbrüggen
2006-05-24  5:26   ` robin
2006-05-23  8:34 ` gautier_niouzes
2006-05-23 13:33 ` Nasser Abbasi
2006-05-23 14:00   ` Michael Metcalf
2006-05-23 15:04   ` beliavsky
2006-05-23 18:09     ` glen herrmannsfeldt
2006-05-23 22:38     ` Jeffrey Creem
2006-05-23 19:29   ` Gautier
2006-05-23 19:34     ` Rich Townsend
2006-05-23 17:57 ` Aldebaran
2006-05-23 22:14   ` Dr Ivan D. Reid
2006-05-23 23:01 ` John
2006-05-27  5:01 ` Nasser Abbasi
2006-05-27  7:36   ` Pascal Obry
2006-05-27 11:18   ` Björn Persson
replies disabled

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