[bitc-dev] Libraries and separate compilation
Pierre THIERRY
nowhere.man at levallois.eu.org
Thu Mar 27 21:33:59 EDT 2008
Scribit Jonathan S. Shapiro dies 27/03/2008 hora 15:23:
> 2. Include the ASTs (or equivalent) in the static archive
> library that accompanies the dynamic library. Generate
> any missing code at static link time or (if the linker
> supports link-once semantics) at module compile time.
>
> Issue: This has an unintended consequence: any instance that
> is pre-instantiated by the library now becomes part of
> the link layer interface contract, because the runtime
> system cannot instantiate it at run time.
Isn't it possible for the static linker to always instantiate all
instances that it needs, even if they have already been somehow? That's
what you obtain with C++ templates, AFAICT (except that they're not
instantianted at link time, but at compile time).
On the other hand, being able to provide pre-instantiated instances
could be a useful optimization WRT code size, compared to C++ templates.
A library could then provide some useful pre-instantiations for types it
provides. And if some instances are known to be used among a vast
project, you can create a library to make those instances available.
Even if that's an unintended consequence, it seems to have interesting
virtues.
Hopefully,
Pierre
--
nowhere.man at levallois.eu.org
OpenPGP 0xD9D50D8A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.coyotos.org/pipermail/bitc-dev/attachments/20080328/ab55d0d4/attachment.bin
More information about the bitc-dev
mailing list