> What I assume you are saying is helper is some Nim source program that will 
> produce the output that gemPGparameters does. The expression you give will 
> then execute helper at run time and provide its results to const parameters 
> at its compile time. Is this interpretation correct?

Exactly.

> Your response suggests the current compiler won't accommodate this amount of 
> data generation at compile time. I guess my question is why?

Well we don't want the compiler to run into infinite loops. And we cannot solve 
the halting problem either, so instead we restrict the number of back jumps in 
the VM. Btw the limit is currently at 1_500_000 which was enough for anything.

> Why not create a compiler directive to remove any time/data constraints to 
> compile time activity? Make the compiler do what the programmer wants.

Could be an option but since compile-time evaluation is slower than native code 
by a factor of about 20 I don't think this is doing potential client users of 
your module any favours. `staticExec` has been designed for these things, it 
can even cache the results.

Reply via email to