>>>>> "Simon" == Simon Marlow <[EMAIL PROTECTED]> writes:
Simon> If I understand this right, you're suggesting essentially
Simon> dumping out part of the Haskell heap to a file. Assuming
Simon> the data you want to dump out is closed (i.e. has no
Simon> external references) and is fully evaluated, there are
Simon> still some problems remaining:
Simon> - The data is location-dependent, and the exact
Simon> location the data was originally resident at might not be
Simon> available at load-time, so it would have to be relocated.
No need to relocate on an Alpha - just use a different high 32-bits
for each persistent store. Not that I've got an Alpha yet...
BTW I will probably get an Alpha sometime for running ghc, but it
will be running Linux. Am I right in thinking that porting ghc to
Linux/Alpha would be just a matter of mixing and matching from the
Linux/i386 and OSF/Alpha ports ?
Simon> - Heap-resident data in GHC refers (by address) to the
Simon> code of the program itself, and to parts of the run-time
Simon> system. You'd have to do some kind of dynamic linking to
Simon> be able to load data back again.
I didn't think of this. Are you referring to the way the STG machine
always jumps (via a pointer) to entry code when entering a closure
(even an evaluated one) ? Do you think the dynamic linking would be
practical (it sounds like a lot of pain) ?
BTW does ghc support generating shared libraries (under Linux) ? Last
time I tried (maybe a year ago) it didn't seem to like -optc-fpic -
IIRC the executables just seg-v'ed.
Simon> - The format of heap-resident data varies depending on
Simon> things like profiling, so you wouldn't be able (for
Simon> instance) to load data generated by a profiled program into
Simon> one that isn't.
It would also vary between platforms, so Native or Binary would be
needed to transport data. Arguably, moving data between profiling and
non-profiling programs falls in this class.
Simon> program to save/load data. If you recompiled the program,
Simon> you'd have to regenerate the persistent store.
Even if the recompilation used the same compiler and flags ?
Simon> overly restrictive, it might be simpler to just use the
Simon> Native or Binary classes.
I remember that ghc historically did not support Binary, but maybe
this has changed. In the ghc-3.01 Users Guide, section 4.9 ("Haskell
1.4 vs. Glasgow Haskell 3.00: language non-compliance") does not
mention Binary. Did Binary support sneak in while I wasn't looking ?
If Binary were available, I would be happy to use that - until someone
develops a functional OS.
Tim
--
----------------------------------------------------------------------
T.R.BARBOUR Email : [EMAIL PROTECTED]
----------------------------------------------------------------------
Department of Computer Science
The University of Melbourne
Parkville, Victoria 3052
Australia
----------------------------------------------------------------------