comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <mcondic.auntie.spam@acm.org>
Subject: Re: Array and memory usage
Date: Mon, 10 Mar 2003 06:57:06 -0500
Date: 2003-03-10T11:57:17+00:00	[thread overview]
Message-ID: <b4huit$crl$1@slb6.atl.mindspring.net> (raw)
In-Reply-To: x6Saa.25310$eG2.4454@sccrnsc03

They're all "Quality Of Implementation" issues :-)

Here's the thing: In Ada, it is *theoretically* possible for compilers to do
a wonderful job with all sorts of things. However, when one starts examining
the output of the available compilers in given circumstances and discovers
that the output is *universally bad* in some respect, what difference does
it make that the compiler writers might actually be able to do better? The
fact is they didn't do better and unless you have truckloads of money to
give them and months/years to wait for the end result, you're not going to
get the output you want.

In fairness to the compiler writers, they often start from some general
solution that works (albeit inefficiently) for all cases, then they start
looking at optimizations. In the case of a record type with default initial
values, one can see that the initialization could be problematic in
different contexts. If you declare the record globally, you'd like for that
global memory to be statically initialized and your load image just has the
bits set the way you want them. But what about when the record is allocated
on the stack? Or if it comes from the heap? Or if one of the initializations
is a function call? So they write an initializer that works for all the
cases and the global memory variant suffers. There are probably lots of
similar examples. In scenarios like that, you've got to work with fooling
the compiler into doing what you want or working with various other
techniques of getting the job done. (One can always resort to C and get the
desired output. :-)

So I guess the gripe is that while Ada may allow for efficient
implementation it often doesn't get there because its just too hard to do it
all. Sometimes you have to avoid the spiffy features because they aren't
implemented well. Mostly, this is a realtime/embedded complaint that I have
not had problems with in building workstation apps. Oddly, Ada works better
in an adopted domain than it does in the domain it was intended for
sometimes. :-)

MDC
--
======================================================================
Marin David Condic
I work for: http://www.belcan.com/
My project is: http://www.jsf.mil/

Send Replies To: m c o n d i c @ a c m . o r g

    "Going cold turkey isn't as delicious as it sounds."
        -- H. Simpson
======================================================================

Mark Biggar <mark.a.biggar@attbi.com> wrote in message
news:x6Saa.25310$eG2.4454@sccrnsc03...
> >
> > If you care about code size and efficiency, you can find a number of
> > "surprises" and "gotchas" with Ada.
>
> Shouldn't the preelaborate pragma help with this problem?  Otherwise
> this is obviously a "quality or implementation" issue.
>






  reply	other threads:[~2003-03-10 11:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-09 11:19 Array and memory usage Preben Randhol
2003-03-09 11:52 ` John R. Strohm
2003-03-09 12:11   ` Preben Randhol
2003-03-09 13:34     ` Marin David Condic
2003-03-09 15:05       ` Preben Randhol
2003-03-10  1:45       ` Mark Biggar
2003-03-10 11:57         ` Marin David Condic [this message]
2003-03-10 12:06           ` Jeffrey Creem
2003-03-09 17:49     ` Robert A Duff
2003-03-09 17:04 ` Jeffrey Creem
2003-03-09 17:09   ` Preben Randhol
2003-03-09 18:10 ` Robert A Duff
2003-03-10 15:13   ` Matthew Heaney
2003-03-10 23:33     ` Robert A Duff
2003-03-11  0:40       ` Randy Brukardt
2003-03-11 23:37         ` Robert A Duff
2003-03-12 19:18           ` Randy Brukardt
2003-03-11 16:01       ` Matthew Heaney
2003-03-11 17:38       ` Warren W. Gay VE3WWG
  -- strict thread matches above, loose matches on Subject: below --
2003-03-12 22:04 Alexandre E. Kopilovitch
2003-03-12 22:20 ` Larry Kilgallen
replies disabled

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