Again: FFI syntax

Simon Peyton-Jones simonpj at microsoft.com
Mon May 14 04:37:41 EDT 2001


| Comments? We should really come to an agreement on the syntax soon...

Generally, I like it.

| An open point is the last case of the include production: 
| Should we implicitly wrap double quotes around it or not? I 
| don't really like such implicit things, but
| 
|     foreign import ccall "static !myproc \"myinclude.h\"" 
| myProc :: ...
| 
| could look a little bit funny because of the backslashes. 
| Again, I don't really mind about that topic. But I'm against 
| implicitly suffixing with '.h' in any case.

I'd go for automatically adding quotes.  Acutally, I'd automatically add
a '.h' too.  Reason: you are really specifying the assembly or package
where the function comes from, and that might be useful for linking as
well as includes.   If the package was called P, the compiler can
#include "P.h", and in addition say -lP on its link command.  That's
less
convenient if there's a .h to strip off.

Simon




More information about the FFI mailing list