[Vm-dev] Re: FFI syntax

Igor Stasenko siguctua at gmail.com
Fri Mar 25 11:47:10 UTC 2011


On 25 March 2011 12:28, Bert Freudenberg <bert at freudenbergs.de> wrote:
>
> On 25.03.2011, at 12:06, Torsten Bergmann wrote:
>
>> 1. why is it still hard to interface with the outside world
>>    from Squeak (is it a problem of current FFI implementation,
>>    the lack of callbacks, lack of pinned objects, ...)
>>    I doubt that it is a problem of Syntax, although I liked
>>    the way it was done in Smalltalk/MT and Smallscript:
>
> IMHO it's just lack of interest. One of the reasons people choose Squeak is its "cross-platform-ness", so adding specific platform support rarely gets larger traction. But projects like Mars show it's possible, you just really need to want it :)
>
>> Example ST/MT:
>>
>>   WINAPI MessageBox: NULL
>>     with: result asString
>>     with: 'Can you do this in another language'
>>     with: MB_YESNO | MB_ICONHAND
>>
>>   Callback methods are in special method categories.
>>
>> Example Smallscript/S#:
>>   User32::MessageBox(NULL,'Hello','World',0)
>
> This has not much to do with FFI syntax itself. But *someone* created those classes. In Squeak, you would just need to create a "WINAPI" or "User32" class that provides all the functions.
>
> That's how the OpenGL bindings work in Croquet, for example. As a user you just call the OpenGL functions, someone else took care of providing the FFI calls.
>
yep. lets not mix ffi annotation syntax with stuff which uses it,
which is completely up to developer :)


> - Bert -
>
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list