From: Sean O'Halpin Date: 2008-12-11T02:30:49+09:00 Subject: Re: Standardizing FFI based wrappers On Wed, Dec 10, 2008 at 10:11 AM, Luc Heinrich wrote: > Greetings, > > Back in november, when FFI 0.1.1 was released, there was a beginning of an > interesting discussion about "standardizing" the way FFI based wrappers > should be named, organized and packaged, in order to create a clean and > useful (and hopefully growing) FFI "ecosystem" I'm also interested in feedback. I'm working on an FFI wrapper for ncurses. I haven't released a gem yet though the project is on github if anyone's interested in work-in-progress: http://github.com/seanohalpin/ffi-ncurses/tree/master. This is how I'm planning to address the issues raised by Luc: = Organisation The gem will be called ffi-ncurses and will live in its own directory rather than under ffi/ncurses. I would like to call the module FFI::NCurses but would appreciate some feedback as to whether people think this is a good idea. Would it be polluting the FFI namespace? = Packaging No change here - thin wrapper only. The only really tricky decision is what to do about macros. For example, in ncurses there are macros to return the yx coordinates, like this: #define getyx(win,y,x) (y = getcury(win), x = getcurx(win)) used like this: int x, y; getyx(win, y, x); i.e. it directly updates the variables passed in. They are convenience wrappers to obviate the fact that C cannot return multiple values. I've translated them to work like this: y, x = getyx(win) Not a literal translation, but certainly (IMHO) in the spirit of the macro. (But as they say in Italian: traduttore, traditore :) Again, any feedback here would be welcome. = Naming As mentioned above, I'm going to call the gem ffi-ncurses (and version 0.1.0 will be out real soon now). = Other issues - Do we want to distinguish operating system specific libraries, e.g. ffi-win32-console, ffi-darwin-growl_plugin? Regards, Sean