[MLton] Re: idea

Vesa Karvonen vesa.a.j.k at gmail.com
Wed Oct 31 06:47:49 PST 2007


Hi,

If I'm reading the code right, the code for loading a world (at
initialization time --- I think that there were some issues with
loading a world in MinGW
(http://mlton.org/pipermail/mlton-user/2007-June/001126.html)) lives
in runtime/gc/world.c.  To me it looks pretty straightforward code, so
modifying it probably wouldn't be very difficult.  The main problem I
see is that, AFAIK, the way you access resources in Windows is through
an API that eventually gives you a void pointer to the raw data in
memory.  OTOH, the code for loading a world assumes that it is reading
the data from a file.  So, one would need to introduce a bit of
abstraction into the world loading code to make it possible to read
from both a file and from a raw memory block.  Shouldn't be too hard.

-Vesa Karvonen

On Oct 31, 2007 1:53 PM, Dave Herman <dherman at ccs.neu.edu> wrote:
> How hard do you think it would be to stick a World file inside of an
> executable and create a MLton API for loading a resource out of an
> executable, in addition to being able to load from a separate file? That
> way it would be possible to generate self-contained executables with
> cached computations.
>
> If it's just an issue of how to generate the executable, I can look into
> the platform-specific API's for doing that.
>
> Thanks,
> Dave



More information about the MLton mailing list