A modest proposal: eliminate template code bloat

Dmitry Olshansky dmitry.olsh at gmail.com
Sun Apr 8 11:56:43 PDT 2012


On 08.04.2012 22:51, Walter Bright wrote:
> On 4/8/2012 4:01 AM, Dmitry Olshansky wrote:
>> I think it's been ages since I meant to ask why nobody (as in compiler
>> vendors)
>> does what I think is rather simple optimization.
>
> I worked out how to do it a while ago, but there's been no time to
> implement it.
>
> (You can't do a memcmp because of all the relocations.)

Yes, I thought there must have been some problem with it.

>
> The main difficulty is not being able to modify the linker. So you're
> pretty much limited to what the compiler is able to do before linking. D
> does allow the compiler to deal with all the modules at compile time, so
> this helps a lot.

I'm thinking what if we kind of do it as an extension so that your 
linker (e.g. optlink) knows about these checksums (or whatever you use 
instead) while normal linker just works the way it always did.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list