compile-time evaluation

D. Tweed
Wed, 6 Feb 2002 11:02:09 +0000 (GMT)

On Wed, 6 Feb 2002, David Feuer wrote:

> 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 

While I too would like a some way to enable `continuing where it left off'
for applications without having to actually write or design them that way.
(Particularly using laptops so much :-) ) But I think this is much better
dealt with at the OS level (I believe this is commonly called
checkpointing, something EROS ( was/is supposed to do).
That way not only is it applicable to all language programs automatically,
but it seems AFAICS the only way to tackle issues like resurrecting all
the file descriptors that a program had open, etc.

> 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.

That's an attractive idea, but I'm not sure if it scales: I've got a
program that uses some clever kernel method to output `person' or
`non-person' over a digital surveillance sequence covering two hours. Even
with a compressing camera it's going to be at least 75MB. I run that over
six different `tapes' and the `seen input before cache' is up to half a

Of course the system would be designed to have limits, but then things
start to get complicated about what they should be, how the cache eviction
policy works, etc. I think this really is only feasible where the
programmer explicitly does this (using some convenient persistence
library). Might be wrong though :-)

___cheers,_dave_________________________________________________________|`...heat generated by its microprocessors will|slope upward exponentially, reaching the power
work tel:(0117) 954-5250 |density of a nuclear reactor before 2010'-Intel