From: Sean O'Halpin Date: 2008-11-06T01:54:25+09:00 Subject: Re: FFI 0.1.1 (Foreign Function Interface) for Ruby 1.8.6/7 and 1.9 On Wed, Nov 5, 2008 at 4:34 AM, Charles Oliver Nutter wrote: > > Tom Enebo actually suggested just naming them the library name, as in > libncurses, libtommath, whatever. That's a little *nix-centric, no? If we had everything under ffi/ you'd be able to find everything in one place (e.g. easier to find examples to copy from, easier to set up conventions for where to put shared structs, constants, etc.). As for OS-specific libs, there could be ffi/win32/ ffi/unix, where appropriate. It would be useful to have conventions on how to implement thin layer ffis (e.g. how to handle return values in *ptrs, how to implement functons defined as macros, namespacing constants, etc.). This would help POLS. Also, guidelines on how to portably implement layers for 32-bit/64-bit and endian-ness would be handy (I know I'd like some tips). While there is no general solution to converting header files, projects such as SWIG have shown that you can get a lot done automatically. It would be worthwhile to work on tools to help with this - even an 80% solution removes a lot of the donkey work (as I'm finding with my ncurses port). My general opinion is that the more boring, mechanical, choice-free and thoughtless we can make this work, the easier it will be to do and so the more likely to get done. Your cross-implementation FFI initiative is very welcome - it's a liberating move. Now we can get on with the mindless (but worthy) drudgery :) Regards, Sean