comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: Beware: Rep spec on an enumeration type causes code explosion
Date: 1997/12/15
Date: 1997-12-15T00:00:00+00:00	[thread overview]
Message-ID: <EL972L.6B2.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: dewar.881948014@merv


Robert Dewar (dewar@merv.cs.nyu.edu) wrote:

: ...
: I really don't know what other compilers do here! But I suspect this whole
: area may be quite compiler dependent, so I suggest that you benchmark your
: particular usage against the compilers you are considering using, advice
: that always makes sense!

This kind of statement is exactly what makes me feel the feature
should not have been in the language in the first place, or
as Robert suggested, the operations that might involve mapping
would be prohibited (though that means the enum. rep. clause has
more effect on semantics than is usually allowed).  Interestingly,
the Ravenskar real-time workshop proposed a restriction that essentially 
means "no potentially expensive holey-enum-type operations."

Of course all readers of this news thread will now be more careful in 
their use of the holey enum type feature.  However, my preference is for 
language features whose (reasonably) efficient implementation is 
essentially intuitively obvious, with all compilers 
doing essentially the same thing, and all programmers having an 
intuitive grasp of the overhead of various operations.  If you have
to start running examples through a compiler to learn how to properly
use a language feature on that particluar compiler, that is a bad 
sign...

Of course nifty optimizations are nice, but they should be incremental
improvements on something that is already acceptably fast.  If the
real-time correctness of your program begins to depend heavily on 
particular compiler-specific optimizations/transformations, then the 
"standard" language features are not what they should be.

Other examples where this principle was violated are with generics,
where some compilers macro-expand and others (partially or universally)
share, exceptions, where some compilers introduce an overhead on
entry to a handled-sequence-of-statements and others don't,
on finalization, where the declaration and cleanup overhead 
varies dramatically, on rendezvous, where some compilers have certain
special transformations and others don't, etc.

These differences can dramatically affect the "right" way to use the
language, and that means it really isn't a single language, but rather
a set of languages that happen to share syntax.  This is one case where
putting more implementation guidance into the manual might help establish
stronger norms.  One might even go so far as to include relative timing 
tests into the conformance tests, where operations are required to
take no more than some basic unit, such as the null procedure call time,
or take no more space than that given by some formula.

This is all pretty radical thinking, but for a real-time language, this
might make sense.  The "metrics" paragraphs in the Real-Time annex are
an attempt to push in this direction, where rather than saying something
felt to be "critical" had to be fast, we simply required a vendor to 
measure its performance.  The embarrassment factor would hopefully mean 
that they would spend the energy to make the given "critical" operation 
efficient.

: Robert Dewar
: Ada Core Technologies

--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA




  reply	other threads:[~1997-12-15  0:00 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-05  0:00 Beware: Rep spec on an enumeration type causes code explosion Joe Gwinn
1997-12-06  0:00 ` Robert Dewar
1997-12-08  0:00   ` Joe Gwinn
1997-12-09  0:00     ` Stanley R. Allen
1997-12-06  0:00 ` Robert Dewar
1997-12-06  0:00 ` Corey Minyard
1997-12-08  0:00   ` Joe Gwinn
1997-12-10  0:00     ` Robert Dewar
1997-12-06  0:00 ` Ken Garlington
1997-12-06  0:00 ` Kevin D. Heatwole
     [not found]   ` <dewar.881478386@merv>
1997-12-07  0:00     ` Robert Dewar
1997-12-09  0:00   ` Jim Gleason
1997-12-06  0:00 ` Tucker Taft
1997-12-06  0:00   ` Robert Dewar
1997-12-06  0:00   ` Robert Dewar
1997-12-08  0:00   ` Joe Gwinn
1997-12-08  0:00     ` Mats Weber
1997-12-09  0:00     ` Geert Bosch
1997-12-10  0:00       ` Robert Dewar
1997-12-09  0:00     ` Tucker Taft
1997-12-09  0:00       ` Matthew Heaney
1997-12-10  0:00         ` Charles Hixson
1997-12-10  0:00       ` Jean-Pierre Rosen
1997-12-10  0:00       ` Robert Dewar
1997-12-10  0:00       ` Stephen Leake
1997-12-14  0:00         ` Robert Dewar
1997-12-10  0:00       ` Stanley R. Allen
1997-12-14  0:00         ` Robert Dewar
1997-12-10  0:00       ` Ken Garlington
1997-12-11  0:00         ` John G. Volan
1997-12-11  0:00           ` Ken Garlington
1997-12-12  0:00             ` Matthew Heaney
1997-12-12  0:00               ` Ken Garlington
1997-12-16  0:00                 ` John G. Volan
1997-12-17  0:00                   ` Ken Garlington
1997-12-12  0:00           ` Joe Gwinn
1997-12-12  0:00             ` Robert Dewar
1997-12-16  0:00             ` John G. Volan
1997-12-17  0:00               ` Joe Gwinn
1997-12-17  0:00                 ` John G. Volan
1997-12-18  0:00                   ` Joe Gwinn
1997-12-17  0:00               ` Ken Garlington
1997-12-12  0:00           ` Alan E & Carmel J Brain
1997-12-12  0:00             ` Robert Dewar
1997-12-15  0:00               ` Tucker Taft [this message]
1997-12-16  0:00                 ` Brian Rogoff
1997-12-11  0:00       ` Rakesh Malhotra
1997-12-11  0:00         ` Matthew Heaney
1997-12-12  0:00           ` Rakesh Malhotra
1997-12-12  0:00           ` Samuel Tardieu
1997-12-12  0:00             ` Robert Dewar
1997-12-12  0:00           ` Robert Dewar
1997-12-14  0:00         ` Alan E & Carmel J Brain
1997-12-12  0:00       ` Joe Gwinn
1997-12-15  0:00         ` Robert Dewar
1997-12-16  0:00           ` Joe Gwinn
1997-12-16  0:00             ` Robert Dewar
1997-12-06  0:00 ` David Marshall
1997-12-06  0:00 ` Robert Dewar
1997-12-06  0:00   ` Matthew Heaney
1997-12-10  0:00   ` GNORT information ( Was Re: Beware: Rep spec on an enumeration type causes code explosion ) Mark Bennison
1997-12-10  0:00     ` Robert Dewar
1997-12-06  0:00 ` Beware: Rep spec on an enumeration type causes code explosion Robert Dewar
1997-12-08  0:00   ` Joe Gwinn
1997-12-06  0:00 ` Robert Dewar
1997-12-07  0:00 ` Larry Kilgallen
  -- strict thread matches above, loose matches on Subject: below --
1997-12-09  0:00 tmoran
1997-12-11  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1997-12-11  0:00 Marin David Condic, 561.796.8997, M/S 731-96
1997-12-11  0:00 ` Robert Dewar
replies disabled

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