I want to call a shared object (on Linux) from Squeak. I've been reading the chapter in the "Squeak Book" entitled "Extending the Squeak Virtual Machine". I've read about the "Slang" dialect of Squeak and using it to generate C code - cool!
My question is: If I have a *.so that I want to call from Squeak, should I build another *.so (using Slang) that calls the *.so I need to invoke? Is there another way? Can the *.so be called directly - in some fashion?
Elzbieta
On Thu, 1 Feb 2001, Elzbieta Chludzinska wrote:
I want to call a shared object (on Linux) from Squeak. I've been reading the chapter in the "Squeak Book" entitled "Extending the Squeak Virtual Machine". I've read about the "Slang" dialect of Squeak and using it to generate C code - cool!
My question is: If I have a *.so that I want to call from Squeak, should I build another *.so (using Slang) that calls the *.so I need to invoke? Is there another way? Can the *.so be called directly - in some fashion?
Check out FFI - http://minnow.cc.gatech.edu/squeak/1414
-- Bert
Elzbieta Chludzinska elzbieta@operamail.com is widely believed to have written:
My question is: If I have a *.so that I want to call from Squeak, should I build another *.so (using Slang) that calls the *.so I need to invoke? Is there another way? Can the *.so be called directly - in some fashion?
As others have mentioned you can use the FFI facility to call shared libraries, but if you have any need for better performance, better security or in general tighter control, it would be worth writing the intermediary Slang plugin. Amongst other things it can provide a nice insulation layer between evil code and your image.
tim
squeak-dev@lists.squeakfoundation.org