The buildCall functions are named that for a reason. Essentially, each
time you call
buildCall3 ((getSymbol libc "foo"), (cUlong, cString, cUint), cUlong)
you are compiling a new interface function.
You should only ever call buildCall at the top level or in a structure.
You can apply the resulting function as you would an ML function.
There are still inefficiencies in the FFI but I wouldn't expect them to
be enormous.
David
On 29/08/2016 09:51, Kostirya wrote:
I noticed that PolyML FFI (v5.6, Foreign structure) 100 times slower than
MLton and Haskell FFI, and 10 times than Perl. :-(
But why? After all, Haskell uses also libffi...
P.S.
I used
buildCall3 ((getSymbol libc "foo"), (cUlong, cString, cUint), cUlong) (0,
s, String.size s)
and
buildCall3 ((getSymbol libc "foo"), (cUlong, cPointer, cUint), cUlong) (0,
s, String.size s)
for test.
Nick.
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml