Introducing the "lookup-constants runtime system" :)

Anoq of the Sun anoq@HardcoreProcessing.com
Tue, 02 Oct 2001 19:04:10 +0200



Stephen Weeks wrote:
> I prefer your solution of having
> command-line switches to generate and use the lookup-constants file.

Sounds OK... However, it seems that during linking of the
lookup-constants program, it is linking with -lmlton and
-lgmp. Is this necessary at all? Because if it is, we
still have the hen and the egg problem that libmlton is not
crosscompiled, so it cannot crosscompile the lookup-constants
either, but to crosscompile libmlton we need to first
crosscompile lookup-constants.

> Then, you
> only need to rerun the lookup-constants program on the target machine when the
> set of primitives changes.  For sanity checking, it would be best to do some
> kind of error checking to make sure that the lookup-constants pass is reading in
> the values of the constants that it expects.  The easiest thing would be to
> print each constant name on a line before printing its value.  Then, when lookup
> constants loads the file, it can check.  I also like having the ability to load
> a lookup-constants file because one can imagine generating it in other ways or
> even hand editing it in certain situations.

Ehm, I think I prefer not to be the one adding these checks :)

> We've just discovered another complexity with compile time constants.  Some
> (like Posix_error_access) should be set according to the target and some (like
> MLton_safe) should be set according to the host.  I wanted to make you aware of
> this problem and let you know that we are thinking about it.  You may want to
> hold off until we have a solution, which may involve changing the _prim syntax.

Ouch! :) But I guess this would only apply to some MLton-specific
constants - right? Maybe they just need to be handled separately...

I think for now that I will give it one more try of compiling the
lookup constants to Win32 and executing it there. I will not do
anything further until I hear more.

If you want my current source and you want to implement some of
these changes, I can throw it online. I think (i.e. hope...) that
most of the Win32-specific things are OK. Most of what is needed
is changes to the Makefiles to facilitate the bootstrap.
And I don't feel that I have a good overview of all these
scripts (and scripts are not my strong side anyway...).


Cheers
-- 
http://www.HardcoreProcessing.com