Compile time function execution...

Bill Baxter dnewsgroup at billbaxter.com
Fri Feb 16 00:37:01 PST 2007


Andrei Alexandrescu (See Website For Email) wrote:
> Walter Bright wrote:

> That could be achieved with a watchdog process without changing the 
> compiler, and it's more flexible.
> 
> I think you just let the compiler go and crunch at it. Since you 
> esentially have partial evaluation anyway, the execution process can be 
> seen as extended to compile time. If you have a non-terminating program, 
> that non-termination can be naturally manifest itself during 
> compilation=partial evaluation.

It would be nice though, if the compiler could trap sigint or something 
and spit out an error message about which part of the code it was trying 
to compile when you killed it.

Otherwise debugging accidental infinite loops in compile time code 
becomes...interesting.

--bb



More information about the Digitalmars-d mailing list