Compile time function execution...

BCS ao at pathlink.com
Thu Feb 15 15:15:32 PST 2007


Reply to Michiel,

> BCS wrote:
> 
>> 6) when the whole program is const foldable, e.i. no runtime inputs,
>> like with some scientific software.
>> 
> That's interesting. What kind of program has no runtime inputs?
> 
> And why would it be a problem if the whole program is reduced to
> printing constants to the output? It would certainly be small and
> fast.
> 

I have a program that calculates the number of N length sequences whose sum 
is less than M. M and N are consts so it has no inputs. Runtime speed is 
of no more importance than compile time speed because I only need to run 
it once for each time I compile it. I'd rather let the CPU do the crunching 
rather than the DMD. It takes about 15min to run as is, so that would be 
about 1500+ min under DMD.





More information about the Digitalmars-d mailing list