comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: Efficiency of code generated by Ada compilers
Date: Fri, 13 Aug 2010 20:01:53 +0200
Date: 2010-08-13T20:01:54+02:00	[thread overview]
Message-ID: <4c658892$0$6766$9b4e6d93@newsspool3.arcor-online.net> (raw)
In-Reply-To: <12ce49e6-169e-4e35-b82f-27de0d9b1ceb@t20g2000yqa.googlegroups.com>

On 13.08.10 17:10, Elias Salom�o Helou Neto wrote:

>> 1) You can, in more than one way, tell the compiler to suppress most
>> (any?) checks, but people do not advise to do so. Even if I say that I
>> do need that :(

Don't worry. A rule frequently heard is that if your requirements,
either directly or by implication, include highest possible speed,
lowest possible overhead, or whatever, then these are requirements
and Ada (designed to be usable also in hard real-time environments,
as might be mentioned...), must provide for meeting the requirements.
If the LRM did not address absence of checks, Unchecked_Conversion etc.,
this goal would not be met, nor Ada's, see below.

Some here have been involved in an almost insane effort to achieve
highest possible speeds, very much at the cost of a clear,
obvious algorithm.  And of course we couldn't tolerate any
checks in a program that we knew wouldn't need them!
A nice result is that the programs still do not need
to resort to CPU-specific macros, say, to achieve highest speed.
They use plain Ada and the compiler produces good code.
(BTW, one can use standard Ada facilities to have the compiler
"try" different object code, via representation clauses, or suitably
defined (and sized) types.)

>> 2) It is not necessary for the compiler to actually suppress any
>> checking! It seems that the LRM demands the compiler to allow you to
>> misunderstood something here.

> ask for the suppression, but it does NOT mandate the compiler to
> actually
> skip such checks. Well, this is, to say the least, funny - unless I

1. An authoritative comment from an ARG member has been (more than
once) that the LRM never requires anything stupid, or funny, as
you have put it.  Range checking can be turned off. (In fact,
the SPARK effort can be understood to mean that a SPARK
program can run without checks because it has been analyzed
and found to be without need for any checks.)

2. By the AS-IF rule, a compiler need not even introduce checks
where it can show at compile time that none are needed.  I think
Dmitry has hinted at this.

3. Even though pedantically one might insist on what seems written
in the LRM and dismiss the implications of equally dependable
1. and 2., it helps remembering that you cannot do so in the
real world:
From the outset Ada was made by and for customers. This is documented
in the archives.  If the LRM had mandated funny things, like
precluding perfectly normal compiler pragmatics, there would have
been little support (and the whole thing wouldn't be consistent
with Ada language requirements).

4. The description (however obsolescent) of pragma Suppress
mentions "permission"; an indication that programmer allows
compiler to suppress.  Consequently, and consistent with what
is usually the case with many other language AFAIK, suppressing
checks is a compiler thing, and the LRM even expressly mentions
this.

In fact, documents have been more explicit.
This is from the June 1978 Requirements

"1D. Efficiency. The language design should aid the production of efficient
object programs. Constructs that have unexpectedly expensive implementations
should be easily recognizable by translators and by users. Features should
be chosen to have a simple and efficient implementation in many object
machines, to avoid execution costs for available generality where it is not
needed, to maximize the number of safe optimizations available to
translators, and to ensure that unused and constant portions of programs
will not add to execution costs. Execution time support packages of the
language shall not be included in object code unless they are called."

http://archive.adaic.com/docs/reports/steelman/steelman.txt

I think you can rely on programmer control over checks.


Georg



  reply	other threads:[~2010-08-13 18:01 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-06 20:21 Efficiency of code generated by Ada compilers Elias Salomão Helou Neto
2010-08-06 20:24 ` (see below)
2010-08-06 23:14 ` Shark8
2010-08-07  7:53 ` Dmitry A. Kazakov
2010-08-10 13:52   ` Elias Salomão Helou Neto
2010-08-10 14:24     ` Shark8
2010-08-10 14:28     ` Shark8
2010-08-10 15:01     ` Robert A Duff
2010-08-10 15:14       ` Yannick Duchêne (Hibou57)
2010-08-10 18:32         ` Robert A Duff
2010-08-10 15:10     ` Georg Bauhaus
2010-08-10 15:32     ` Dmitry A. Kazakov
2010-08-10 22:26     ` Randy Brukardt
2010-08-20  7:22       ` Yannick Duchêne (Hibou57)
2010-08-08 14:03 ` Gene
2010-08-08 15:49   ` Robert A Duff
2010-08-08 17:13     ` Charles H. Sampson
2010-08-08 18:11       ` Dmitry A. Kazakov
2010-08-08 20:51       ` Robert A Duff
2010-08-08 22:10         ` (see below)
2010-08-08 22:22           ` Robert A Duff
2010-08-09  4:46         ` Yannick Duchêne (Hibou57)
2010-08-09  5:52         ` J-P. Rosen
2010-08-09 13:28           ` Robert A Duff
2010-08-09 18:42             ` Jeffrey Carter
2010-08-09 19:05               ` Robert A Duff
2010-08-10 10:00                 ` Jacob Sparre Andersen
2010-08-10 12:39                   ` Robert A Duff
2010-08-09 19:33             ` Yannick Duchêne (Hibou57)
2010-08-09 21:42               ` Robert A Duff
2010-08-10 12:26         ` Phil Clayton
2010-08-10 12:57           ` Yannick Duchêne (Hibou57)
2010-08-10 14:03             ` Elias Salomão Helou Neto
2010-08-10 14:27               ` Yannick Duchêne (Hibou57)
2010-08-10 22:50                 ` anon
2010-08-10 23:28                   ` Yannick Duchêne (Hibou57)
2010-08-10 23:38                     ` Yannick Duchêne (Hibou57)
2010-08-11  7:06                       ` Niklas Holsti
2010-08-11 11:58                         ` anon
2010-08-11 12:37                           ` Georg Bauhaus
2010-08-11 13:13                         ` Robert A Duff
2010-08-11 23:49                           ` Randy Brukardt
2010-08-10 14:31               ` Shark8
2010-08-11  7:14               ` Charles H. Sampson
2010-08-11  6:42         ` Charles H. Sampson
2010-08-08 22:35     ` tmoran
2010-08-09 13:53       ` Robert A Duff
2010-08-09 17:59         ` tmoran
2010-08-09 19:36           ` Yannick Duchêne (Hibou57)
2010-08-09 21:38             ` Robert A Duff
2010-08-11  7:42       ` Charles H. Sampson
2010-08-11 13:38         ` Robert A Duff
2010-08-12  7:48           ` Charles H. Sampson
2010-08-12  8:08             ` Ludovic Brenta
2010-08-12 17:10               ` Charles H. Sampson
2010-08-12 18:06                 ` Jeffrey Carter
2010-08-11 18:49         ` Simon Wright
2010-08-12  7:54           ` Charles H. Sampson
2010-08-12  8:36             ` Dmitry A. Kazakov
2010-08-12 11:04             ` Brian Drummond
2010-08-12 19:23             ` Simon Wright
2010-08-12 20:21               ` (see below)
2010-08-13 15:08                 ` Elias Salomão Helou Neto
2010-08-13 15:10                   ` Elias Salomão Helou Neto
2010-08-13 18:01                     ` Georg Bauhaus [this message]
2010-08-13 19:52                       ` Robert A Duff
2010-08-14  9:44                         ` Georg Bauhaus
2010-08-13 20:22                     ` Robert A Duff
2010-08-14  1:34                       ` Randy Brukardt
2010-08-14  7:18                         ` anon
2010-08-13 21:57                     ` Jeffrey Carter
2010-08-13 22:37                       ` Yannick Duchêne (Hibou57)
2010-08-13 22:43                         ` Yannick Duchêne (Hibou57)
2010-08-13 23:29                         ` tmoran
2010-08-14  0:02                           ` Yannick Duchêne (Hibou57)
2010-08-14  0:16                             ` (see below)
2010-08-14 10:47                             ` Brian Drummond
2010-08-14 13:58                               ` Yannick Duchêne (Hibou57)
2010-08-15  0:23                                 ` Brian Drummond
2010-08-14 14:51                               ` (see below)
2010-08-15  0:58                                 ` Brian Drummond
2010-08-15  1:58                                   ` (see below)
2010-08-15 10:31                                     ` Brian Drummond
2010-08-13 15:37                   ` Dmitry A. Kazakov
2010-08-16 13:29                     ` Elias Salomão Helou Neto
2010-08-16 14:09                       ` Dmitry A. Kazakov
2010-08-18 14:00                         ` Elias Salomão Helou Neto
2010-08-18 16:38                           ` Dmitry A. Kazakov
2010-08-19 18:52                             ` Elias Salomão Helou Neto
2010-08-19 19:48                               ` Dmitry A. Kazakov
2010-08-13 16:58                   ` (see below)
2010-08-14 16:13                   ` Charles H. Sampson
2010-08-16 13:45                     ` Elias Salomão Helou Neto
2010-08-15 12:32 ` Florian Weimer
replies disabled

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