Re: OON: Re: Can separate compilation deal with expression templates ?

From: Jim Edwards (tavison@yahoo.com)
Date: Sat Apr 14 2001 - 03:54:22 EST


--- Andrew Reilly <areilly@bigpond.net.au> wrote:
> On 12 Apr, Manuel Kessler wrote:
> > On Thu, 12 Apr 2001, Andrew Reilly wrote:
> >
> >> On 11 Apr, Jim Edwards wrote:
> >> > The export keyword should do this, but I don't
> know of
> >>
> >> Really? I'm very surprised that anyone even
> thinks that this is
> >> possible.
> >
> > It is actually quite simple (at least
> conceptually): when compiling the
> > template source, don't generate code, but put some
> intermediate form
> > (e.g. the parse tree or something equivalent,
> possibly even the plain
> > (tokenized) source) and the necessary context
> (about
> > dependent/nondepedendent) names into the library.
> Then make the linker
> > smart enough to make (at instantiation time) a
> callback to the compiler
> > with the now known values for the template
> parameters, so that actual code
> > can be generated. Instantiation may trigger other
> template instantiations
> > until this recursion ends (otherwise the source is
> buggy). The library
> > then works as some kind of template repository.
>
> That's essentially the structure that I described in
> the piece of
> my message that was clipped.
>
> I still don't see why that is thought to be more
> useful than
> putting the template definitions in header files.
> The effect is
> the same. The code still has to be compiled before
> it can run.
>

I talked to the programmers from the Visual C++ team
when I was at GDC (Game Developers Confrence) and they
told me that the two parts of the standard that would
not be in the next c++ was Partial specialazation of
templates, and partial ordering. I did not ask about
export, but I am compelled to believe it is included.
The compiler is available for beta testing, but I have
not tried it yet. I was told (Very hush hush, but who
cares) that partial specialization will be in the
first patch.
As to why it is usefull, it runs along the idea that
users of a class should not be burdend with the
specifics. I know I've written code in headers that
other programmers think they should "read" because it
is in a header. With export, I can hide the ugly
template code behind a freindly user interface.
This also allows me to hide my super secret, change
the world, brilliant code. This is more an issue for
the business people, I could care less. I just want
adoption of difficult template code without the users
having hemorages from looking at the specifics.

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:15 EST