[Vm-dev] Re: FFI syntax

Torsten Bergmann astares at gmx.de
Fri Mar 25 11:06:32 UTC 2011


>Glad to hear it. I hate the attitude that the only way to make progress 
>is to break all code in existence. It's a lame and lazy attitude, 
>unworthy of engineers who understand what they're doing.

It always depends on how fast you want to make progress and if you want to carry existing code with you/move it over to something new, correct? ;)

To me two main questions remain:
 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:

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) 


 2. how easy could a FFI (referring to a general framework - not 
    the current implementation we have) be made so that people 
    could easily interface with external stuff 

Especially if there is an answer to the second question one
can think about making it compatible with existing stuff...

I've used FFI a few times (for instance to bind libharu for PDF
generation, see HPDF on squeaksource) and the current syntax was 
no problem. But the lack of callbacks and others ... holds us back 
to provide good bindings to C/C++, COM, Java, ...

Bye
T.


 






-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de


More information about the Vm-dev mailing list