[MLton] target-map considered harmful

Matthew Fluet matthew.fluet at gmail.com
Wed Jan 6 06:50:40 PST 2010


On Tue, Dec 15, 2009 at 7:21 AM, Wesley W. Terpstra <wesley at terpstra.ca> wrote:
> So, I've use a lot of MLton cross compilers and have been looking at
> how to get MLton packages that achieve this. I was hoping in the
> future to be able to type:
>  apt-get install mlton mlton-mingw32 mlton-mipsel
> ... and then get a mlton capable of compiling to my native system,
> mingw32, or mipsel targets.
>
> This seems quite easy to achieve, except the annoying target-map file
> is one file. Adding the needed sml/basis/config/c/xxx/c-types.sml and
> xxx/*.a files in the mlton-mingw32 package is no problem. However, I
> can't just overwrite target-map.
>
> Couldn't we instead have a personality file inside the target folders? eg:
>
> cat self/personality
> i386 linux
> cat i586-mingw32msvc/personality
> i386 mingw

That seems like a fine solution.  I would suggest that we put all of
the targets within a single "target" directory of the lib directory.
That would make it easy to find all the targets.

It might also be good to move the c-types.sml file into the
target-specific directory.  Then a target would be entirely self
contained.



More information about the MLton mailing list