FFI isn't so much difficult as it is a little tedious and, more so, incomplete. 
 Stef has said that a working FFI (callbacks and threads) for all platforms is 
a priority, and is using words like January - that would be NICE.  I would also 
like to see a full set of signed/unsigned single, double and perhaps quad word 
arrays, as well as float and double arrays.  The latter is truly missing; I 
have been very lucky hacking around it.

One thing that is really a shame is that for any of my extended types, I have 
to tell FFI that they are void* :(   At least that's the only way I currently 
know to get them to work.

C++ libraries might be a problem.  In one case, I was able to simply tell FFI 
about the mangled names, and all was well.  If the library goes heavily into 
C++ features across its boundary, you might be better off writing a C-friendly 
wrapper around it.  Remember that once you get inside the opening brace of even 
an extern "C" function, you can use C++ features to implement it.  In 
particular, I have C callable functions that use string streams to generate 
output and templated array classes to access elements.

Bill


________________________________________
From: [email protected] 
[[email protected]] on behalf of Serge Stinckwich 
[[email protected]]


+1
I would love to use Pharo to do more robotics/embedded stuff. For
example, i would like to be able to connect C/C++ computer vision
libraries like OpenCV with FFI/Alien.
But this is still difficult to do that in Pharo. I don't have the
energy and man-power to invest time in this direction. If i ask some
students do to this work, i know that they will have a lot of
difficulties and at end the experience will be not very funny.

Regards,
--
Serge Stinckwich
UMI UMMISCO 209 (IRD/UPMC), Hanoi, Vietnam
Matsuno Laboratory, Kyoto University, Japan (until 12/2011)
http://www.mechatronics.me.kyoto-u.ac.jp/
Every DSL ends up being Smalltalk
http://doesnotunderstand.org/


Reply via email to