compile-time evaluation

David Feuer
Wed, 6 Feb 2002 4:44:08 -0500

>Just saying
>'evaluate this CAF to WHNF' might only inline the outer 

I'm not sure quite what you mean.  However, it seems to me 
that this sort of thing would match the way other things 
happen in Haskell fairly well (i.e., default lazy, 
strictify as necessary).  If you want something to be 
evaluated more deeply, make a CAF to do so, and then tell 
the compiler to evaluate that...  I suspect even this very 
limited control would be useful for some applications that 
would otherwise have long and useless start-up times.  On 
a more adventurous note, I think it would be very 
interesting to be able to ask the compiler to make certain 
values persistent across program executions.  This could 
solve the same problem, but may also help deal with long 
computations that may be interrupted, and should be 
re-started at the same point.  (actually, I think this 
would not be all that great... however, if non-trivial 
memo tables ever get added to GHC, it could be _very_ 
useful to store those across program runs for 
simulations... that way, if the program is given input 12, 
and told to calculate something with it and print it out, 
if the program is interrupted, and re-started with the 
same input, calculation could presumably start at the 
point it left off...).  Of course, I have no clue how 
realistic any of this is.

David Feuer

This message has been brought to you by the letter alpha and the number pi.