comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Sharing generic bodies across instantiations.
Date: Wed, 28 Jul 2010 13:03:16 -0700 (PDT)
Date: 2010-07-28T13:03:16-07:00	[thread overview]
Message-ID: <97a2bf94-9b5b-40fb-abca-f64a2efef627@k19g2000yqc.googlegroups.com> (raw)
In-Reply-To: 4c505b89$0$2372$4d3efbfe@news.sover.net

On 28 Lip, 18:32, "Peter C. Chapin" <pcc482...@gmail.com> wrote:

> The C++ community doesn't talk much
> about a shared implementation of templates. Is that because it's just
> unreasonably difficult in C++?

Or maybe just pointless, regardless of the difficulty.

I don't see any reason for doing it, really. The only possible reason
would be to minimize the size of executable, possibly targeting some
very constrained environment, but there are ways to do it more
efficiently than with code sharing in templates - the technique, based
on making a facade template implemented in terms of non-template
actual code, was described by Scott Meyers, although at the moment I
don't remember exactly which of his book covered it. The major
advantage of this technique was *no performance penalty*. That is -
small *and* fast code.

In other words, the real reason for not having such compiler
implementations might be that simply nobody needs them. Imagine
yourself as a compiler vendor and try to answer a question if it makes
sense to invest effort in this implementation strategy. If nobody asks
for it, then probably not - and the market position of those Ada
compilers that do it (code sharing) when compared to those that don't
might indicate that this technique is not terribly shaking the Ada
community either.

--
Maciej Sobczak * http://www.inspirel.com

YAMI4 - Messaging Solution for Distributed Systems
http://www.inspirel.com/yami4



  parent reply	other threads:[~2010-07-28 20:03 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-27  0:51 Sharing generic bodies across instantiations Peter C. Chapin
2010-07-27  3:01 ` Gene
2010-07-27  6:55 ` AdaMagica
2010-07-27 11:29   ` Ludovic Brenta
2010-07-27 14:10     ` Tero Koskinen
2010-07-27 10:51 ` Martin
2010-07-27 20:06 ` anon
2010-07-27 22:23   ` Peter C. Chapin
2010-07-28  7:59     ` Maciej Sobczak
2010-07-28  9:28       ` Dmitry A. Kazakov
2010-07-28 12:55         ` Maciej Sobczak
2010-07-28 13:16           ` Dmitry A. Kazakov
2010-07-28 19:48             ` Maciej Sobczak
2010-07-29  8:03               ` Dmitry A. Kazakov
2010-07-29 14:02                 ` Maciej Sobczak
2010-07-29 14:40                   ` Dmitry A. Kazakov
2010-07-29 20:27                     ` Maciej Sobczak
2010-07-30  9:09                       ` Dmitry A. Kazakov
2010-07-30 12:31                         ` Maciej Sobczak
2010-07-30 14:59                           ` Dmitry A. Kazakov
2010-08-03  3:02                           ` Randy Brukardt
2010-08-03 14:37                             ` Robert A Duff
2010-08-03  2:47                         ` Randy Brukardt
2010-07-28 20:01             ` Keith Thompson
2010-07-29  7:46               ` Dmitry A. Kazakov
2010-07-28 11:27       ` Peter C. Chapin
2010-07-28 13:10         ` Maciej Sobczak
2010-07-28 16:32           ` Peter C. Chapin
2010-07-28 19:30             ` Robert A Duff
2010-07-28 20:03             ` Maciej Sobczak [this message]
2010-07-28 11:47     ` anon
2010-08-03  2:38     ` Randy Brukardt
2010-08-03 14:31       ` Robert A Duff
2010-07-28  0:55   ` Keith Thompson
2010-07-28  8:42     ` Markus Schoepflin
2010-07-28 11:16     ` anon
replies disabled

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