[MLton] Re: [MLton-commit] r6883

Wesley W. Terpstra wesley at terpstra.ca
Tue Sep 30 15:31:07 PDT 2008


On Tue, Sep 30, 2008 at 11:31 PM, Matthew Fluet <fluet at tti-c.org> wrote:
> On Tue, 23 Sep 2008, Wesley Terpstra wrote:
>>
>> When building a library, assume -default-ann "allowFFI true".
>
>> +      (* It doesn't make sense to have a library without FFI *)
>> +      val () =
>> +         case !format of
>> +            Executable => ()
>> +          | _ => ignore (Control.Elaborate.processDefault "allowFFI
>> true")
>> +
>
> While I agree that it doesn't make sense to build a library that doesn't
> export any functions (and, thus, uses FFI), I don't think that the default
> annotation should be 'allowFFI true'.  Yes, it is a little more concise for
> a one-file *.sml library, but it is an abstraction violation for a
> well-designed, modular, multi-file *.mlb project.  In that setting, you
> would expect a project like:
>
>  foo.mlb (* 'pure' SML *)
>  bar.mlb (* 'pure' SML *)
>  baz.sml (* 'pure' SML *)
>  qux.sml (* 'pure' SML *)
>  ann "allowFFI true" in
>    export.sml (* export functions *)
>  end
>
> Not defaulting to "allowFFI true" ensures that no FFI is used in the 'pure'
> SML portions of the library.

Fair enough. It might make sense to enable it for just sml files then,
just as MLton.* is available for sml files but not mlb files by
default. On the other hand, I don't really care that much. =)

Feel free to revert it and update regresson/library/library-test.



More information about the MLton mailing list