Martin indeed it would be great to have a kind of standard
On Sep 18, 2009, at 12:57 AM, Martin McClure wrote: > Johan Brichau wrote: >> 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. > > I'd like to work toward a standard FFI that works across many > Smalltalk > dialects. Right now, it's too hard to port packages such as > CairoGraphics that call large external libraries. A year ago, I tried > porting CairoGraphics from VW to an early version of GemStone's FFI. > It > was way too much work. > > And GemStone/S 64-bit 3.0, due out probably sometime next year, will > have a completely new FFI. It's probably not too late to influence the > design for better compatibility. > > Is Alien, possibly with some changes, a suitable cross-platform > cross-dialect FFI standard? Or is it too low-level? > > Regards, > > -Martin > > _______________________________________________ > Pharo-project mailing list > [email protected] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
