[MLton] more FFI revisions

Matthew Fluet fluet@cs.cornell.edu
Sat, 6 Aug 2005 13:29:07 -0400 (EDT)


> For the FFI thing (which I haven't had time to really follow yet), please,
> please, don't use comma-separated types (for "symbol" and *).  Yes a single
> type which must be a 2-tuple.  It makes way more sense since that is atleast
> something that already exists in ML.  

Maybe; I can also see the argument that for an _extension_, a syntax that 
isn't easily mistaken for ML is a win.

> Also it is something that you can name (via a type abbreviation) which 
> can be useful.

That is a decent argument.

> Actually, I would way way prefer if you just specified the full type you get,
> even though it involves some duplication.  After all, if that is painful then
> I can (or should) be able to use a type polymorphic type abbreviation for that.
> I.e.,
> 	type ('ptrTy, 'cbTy) t = ('prTy -> 'cbTy) * ('prTy * 'cbTy -> unit)
> and then I use
> 	_symbol * (???, ???) t;
> This strikes me as WAY WAY better.

Again, I don't know how much effort we should invest in making it easy for
people to program in C from ML.  _Use_ C, yes.  But, they shouldn't be
constantly writing down _import/_symbol expressions everywhere.