[MLton] Re: [MLton-user] SVN r6941 MLton/MinGW32 and FFI

Wesley W. Terpstra wesley at terpstra.ca
Tue Nov 11 15:56:44 PST 2008


On Wed, Nov 12, 2008 at 12:26 AM, Matthew Fluet <fluet at tti-c.org> wrote:
> Agreed.  I think most of the documentation on the wiki is pulled directly
> from the SVN repository, so that will be updated when the examples are

You are right. The wiki changed when I changed the examples.

>> I agree, with the added provision that if MLton needs these functions
>> itself it implement them, but not export them.
>
> I can't forsee a reason why, but, in principle, I agree that the MLton
> runtime shouldn't export more than necessary.

There are two cases this can spell trouble:
1. The OS might add the missing functions later, causing a conflict.
(This kept hitting us for the MinGW port.)
2. Other libraries and/or user code might provide them, again conflicting.

Private symbols (so that multiple MLton libraries work) prefixed with
MLton_ (so they don't conflict with other [system] libraries) are the
most durable option. I know macros are ugly/evil, but I think this is
a good place for them.

>> So why were the dl* functions added to mingw.c in the first place?
> Looks like the origin was to get mlnlffi working on MinGW:
>  http://mlton.org/pipermail/mlton/2006-November/029349.html

Using dlfcn-win32 does seem the best approach. I'd like to hear
something from Vesa before removing them.



More information about the MLton mailing list