[MLton] RFC: implement "use" function to support explicit file dependency

James Deng <[email protected]> Wed, 5 Feb 2014 10:16:21 +1100
Newsgroups gmane.comp.lang.ml.mlton.devel
Message-ID <[email protected]>
Hi,

The ML Basis system claims to support programming-in-the-very-large, but I found it very hard to follow the source code without explicit dependency listed.
One key feature of the ML Basis system is “implicit dependencies”. I wonder why implicit dependencies are pursued here. Source files always depend on other files, and actually the dependencies are specified by the other feature of the ML Basis system “explicit file order”.

Here I propose to add implementation of the optional “use” function in the ML basis library, to support explicit file dependencies. To avoid problems, the string argument of “val use: string -> unit” can be restricted to compile-time constants.

I think this approach is simple and intuitive. It is similar to the “#include” directive in C and “import” statement in Java. With this approach, every imported structure or value are easily tracked via “use” statements.
In addition, most SML interactive interpreters support the “use” function, thus code written with “use” can also be portable.


Regards,

James Deng
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk