UFFI on Squeak?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

UFFI on Squeak?

Jakob Reschke-2
 
Hi,

as recently announced, the new Pharo comes with UFFI. In some months,
I plan to begin a Squeak project which will involve binding to a C
library. So my question is, is UFFI in any way a Pharo specific thing
or will there be a port to Squeak (and possibly other environments
running on the Cog VM)? Or is there one already? If not, is it
possible and what is the part that would have to be adapted?

The overlying problem is to choose whether to realize the binding with
FFI, Alien, UFFI or the next best thing if available, or writing a
plugin instead.

Best regards
Jakob
Reply | Threaded
Open this post in threaded view
|

Re: UFFI on Squeak?

EstebanLM

Hi Jacob,

UFFI uses (for now at least) the new IRBuilder from OpalCompiler. While this can be done otherwise and then ported to Squeak, for now is Pharo-only.
The advantage that UFFI gives to you are (most of) the same advantages you had with old NativeBoost: Nice syntax and support for structures, etc. in a “object oriented” way, while in FFI/Alien you are restricted to C basic types [1] and you have to do all the work UFFI does for you manually.

Now, UFFI uses old FFI and Alien as backend, and those two should be working fine in Squeak (while it will also work on Pharo).

cheers,
Esteban

[1] of course you can bind structures with FFI too… is just more difficult :)

> On 18 May 2016, at 13:51, Jakob Reschke <[hidden email]> wrote:
>
>
> Hi,
>
> as recently announced, the new Pharo comes with UFFI. In some months,
> I plan to begin a Squeak project which will involve binding to a C
> library. So my question is, is UFFI in any way a Pharo specific thing
> or will there be a port to Squeak (and possibly other environments
> running on the Cog VM)? Or is there one already? If not, is it
> possible and what is the part that would have to be adapted?
>
> The overlying problem is to choose whether to realize the binding with
> FFI, Alien, UFFI or the next best thing if available, or writing a
> plugin instead.
>
> Best regards
> Jakob