[MLton] mlnlffigen is awesome (was: bootstrap problem)

Stephen Weeks MLton@mlton.org
Fri, 19 Aug 2005 17:11:16 -0700


> is there a reason why the ML Basis system does not support binding
> path variables in the MLB files?
>
> I'm just wondering about the need for three levels of source files:
> 1. SML files
> 2. MLB files
> 3. MLB Path Map files
> 
> Wouldn't it be simpler if there were just two levels:
> 1. SML files
> 2. MLB files (with the ability to bind path variables; importing
>               a basis would bring the path variables to scope)

It could be simpler.  In fact, I've argued on this list before about
combining SML and MLB files.  It might be simplest of all to have a
single level SML+MLB+PATHVARS.

> Has this been discussed earlier?

I don't think so.

Part of the reason for the current split between SML and MLB is to
make it clear to the user when they are leaving (the very well defined
and understood) SML for our (less well defined and understood) MLB
extension.  Part of the reason for the split between MLBs and path
variables is similar.  We tried to specify MLBs in the style of the
Definition, as precisely as we could, see

  http://mlton.org/pages/MLBasis/attachments/mlb-formal.pdf

In order to make the semantics clean, we chose not to formally handle
path variables, relative paths, etc.  With the split between MLBs and
path maps, this is not such a grave omission, since one can imagine a
preprocessor that expands away all relative paths and path variables,
leaving only full paths in MLBs.  Once path variable definitions
become more tightly integrated with MLBs, this simple model no longer
suffices.

This is not to say that your suggestion won't work; just that it needs
some thought and some playing around with the MLB semantics to get a
feel for what it might look like..  Please feel free to run a proposal
by the list -- no need to tex it up, ASCII art inference rules are
fine.

Another point to keep in mind is that path maps and path variables may
play a role in the still ill-defined MLton package system.  It might
be worth considering MLB extensions such as yours in the context of
that too.