A modest proposal: eliminate template code bloat

Marco Leise Marco.Leise at gmx.de
Sun Apr 8 10:32:20 PDT 2012


Am Sun, 08 Apr 2012 20:58:15 +0400
schrieb Dmitry Olshansky <dmitry.olsh at gmail.com>:

> On 08.04.2012 16:37, Marco Leise wrote:
> [snip]
> > Template bloat could be especially important to 'fix' on embedded systems.
> 
> I think I this idea largely formed years ago when I was working with c++ 
> on 8bit micros. You won't believe the amount of code size one can save 
> by using one separate generic save-it-all-then-load-it-all prolog/epilog 
> for all functions (and esp ISRs).
> 
> 
> >  Let's wait till the bugs and important features are implemented or hack the compiler ourselves.
> 
> Let's hack the compiler ;)
> BTW I think it should be possible to apply the idea on the IR level not 
> on the actual machine code.

I don't know compilers, but doesn't the IR level still distinguish between signed and unsigned for example, even though the generated machine code will be the same? Anyway that's what I had in mind with the caching of CTFE as well. To create a hash over the IR (or AST?) of a function (or anything else) and store the hash and the serialized IR into a file next to the object files.

-- 
Marco



More information about the Digitalmars-d mailing list