[Pharo-project] Status of Alien FFI

Johan Brichau johan.brichau at uclouvain.be
Thu Sep 17 04:58:03 EDT 2009


On 16 Sep 2009, at 20:37, Ken Treis wrote:

> * I'm creating a partial Alien library for GemStone so that I can  
> use the CairoGraphics package in both Pharo and GLASS. But on  
> x86-64, there there's a size difference between a pointer/long and  
> an integer. It'd be nice to have some more explicit APIs on Alien,  
> so I could say "Alien newCInteger" or "Alien newCLong" and have the  
> platform return me the proper size Alien. Even without the platform  
> size differences, it seems awkward to use "Alien newC: 4" everywhere  
> I want an integer, "Alien newC: 8" where I want a double, etc.

Exactly.

It becomes worse once you start having structs and nested structs or  
structs with pointers to structs ;-)

I'm using Alien as the FFI to port JavaConnect from Visualworks to  
Pharo/Squeak. As you say, it is a pain to work at such a low-level  
compared to the DLLCC in VW. I am planning to do some work on creating  
a higher-level interface for it such that we can operate it as you  
mention, including the correct bytesizes for all platforms.

At the moment, I'm mostly focusing on getting the port to work right  
before I start creating an interface on top of the current Alien  
interface.

----------------------------
Johan Brichau
johan.brichau at uclouvain.be








More information about the Pharo-dev mailing list